sql - 使用 hive 中的内部连接数据创建一个新表 - 我收到一个错误
问题描述
SELECT
stock_prices_uday.trading_date, stock_companies_uday.symbol,
stock_companies_uday.company_name, stock_companies_uday.headquarter,
stock_companies_uday.sector, stock_companies_uday.sub_industry,
stock_prices_uday.open, stock_prices_uday.close,
stock_prices_uday.low, stock_prices_uday.high
INTO
JOIN1_UDAY
FROM
STOCK_PRICES_UDAY
INNER JOIN
STOCK_COMPANIES_UDAY ON stock_companies_uday.symbol = stock_prices_uday.symbol;
我收到一个错误:
编译语句时出错:失败:ParseException 行 4:1 无法识别表达式规范中“INTO”“JOIN1_UDAY”“FROM”附近的输入
解决方案
Hive 不支持INTO
。使用CREATE TABLE AS
:
CREATE TABLE JOIN1_UDAY as
SELECT stock_prices_uday.trading_date, stock_companies_uday.symbol ,stock_companies_uday.company_name,
stock_companies_uday.headquarter,stock_companies_uday.sector,stock_companies_uday.sub_industry,stock_prices_uday.open,
stock_prices_uday.close,stock_prices_uday.low,stock_prices_uday.high
INTO JOIN1_UDAY
FROM STOCK_PRICES_UDAY INNER JOIN
STOCK_COMPANIES_UDAY
ON stock_companies_uday.symbol = stock_prices_uday.symbol;
推荐阅读
- mongodb - 在 mongodb 中另一个数组内的数组内添加文档
- mongodb - 如何在仅包含Mongodb中日期的数组中获取与时间段条件匹配的所有元素
- r - 如何使用 rvest 和 httr 在同一个会话中多次发布请求?
- javascript - 如何从文本框中更改 window.setInterval(function(){ 值并提交按钮
- visual-studio-code - 如何更改 Visual Studio Code 在 Windows 上格式化代码的方式
- ruby-on-rails - 如何创建一个可以生成无限数量的唯一 URL 的 Ruby 脚本,即。myurl.com/1、myurl.com/2 等等……?
- javascript - React flexbox 元素不适应宽度
- python - Pandas Multi index DataFrame 为每个索引添加子索引
- python - 使用包含子字符串而不是整个键列左连接两个数据框
- objective-c - CARenderer 渲染纹理的 CAMetalLayer 不可见?