HIVE报错原因与修改(持续更新)

Error1:Unsupported SubQuery Expression 'xxx': Correlating expression cannot contain unqualified column references.

ANS : 子查询使用不当造成
hive中是支持not in 语法的 ,只是在not in 中不能接一个子查询

user.id not in ('01','02','03') 这种的查询是可以的
user.id not in (select id from null_user) 是不支持

Error2:cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in subquery source

HQL子查询别名问题
https://blog.csdn.net/dxl342/article/details/50896046

HQL的书写

select * from (select * from table) ;

执行此HQL,应该会报错:ql.Driver (SessionState.java:printError(960)) - FAILED: ParseException line 48:52 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in subquery source
此时,修改HQL为

select * from (select * from table) a

执行成功。

Error 3:In strict mode, if ORDER BY is specified, LIMIT must also be specified.

ANS: 与数据库中 order by 的区别在于在hive.mapred.mode = strict 模式下 必须指定 limit 否则执行会报错。

-- 设定 
set hive.mapred.mode=nonstrict;

Error 4: Warning: Value had a \n character in it.
ANS: 缺了个分号 “;”

Error 5: No partition predicate found for Alias
需要制定分区,减少hive消耗
https://blog.csdn.net/qq_29232943/article/details/79644614

Error6: 找不到变量xxx
SET hivevar: xxx = 20; x
SET hivevar:xxx = 20; √ 注意:号后面不能加空格

Error 7: 需要3个参数,但只给出了2个参数
hive中IF(expr1, expr2, expr3) 必须有三个参数,不能省略最后一个
presto可以省略最后一个,默认为NULL

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,486评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,045评论 0 23
  • "Unterminated string literal.": "未终止的字符串文本。", "Identifier...
    两个心阅读 8,480评论 0 4
  • 想想过去经历的25年,人们从黑白电视机的时代到了投影看视频的时代;从BB机到黑白手机再到智能手机;从fc游戏机到v...
    尘落埃定阅读 251评论 0 0
  • 今天下午和孩子在外面吃饭的时候,隔壁桌的一种家三口真的给我上了生动的一课,这个直白真实的逼迫教育法,真是给了...
    尚巾林阅读 244评论 0 0