在使用hive-2.3.3执行TPC-H benchmark时,遇到hive报错。而且这个错误不是以Java异常栈的形式跑出的,很可能被忽略:

FAILED: SemanticException Cartesian products are disabled for safety reasons. If you know what you are doing, please sethive.strict.checks.cartesian.product to false and that hive.mapred.mode is not set to 'strict' to proceed. Note that if you may get errors or incorrect results if you make a mistake while using some of the unsafe features.

查阅网上资料,发现有两种方法。

方式一:通过hive shell 模式设置相关变量
通过hive 命令开启hive shell 模式,输入以下命令进行设置:

hive> set hive.mapred.mode;   # 首先查看hive.mapred.mode
hive.mapred.mode=strict
hive> set hive.mapred.mode=nonstrict;   # 设置hive.mapred.mode为nonstrict
hive> set hive.mapred.mode;   # 查看hive.mapred.mode是否设置成功
hive.mapred.mode=nonstrict
hive> set hive.strict.checks.cartesian.product;   # 首先查看hive.strict.checks.cartesian.product
hive.strict.checks.cartesian.product=true
hive> set hive.strict.checks.cartesian.product=false;   # 设置hive.strict.checks.cartesian.product为false
hive> set hive.strict.checks.cartesian.product;    # 查看hive.strict.checks.cartesian.product是否设置成功
hive.strict.checks.cartesian.product=false

方式二:在hive-site.xml中设置相关变量
hive-site.xml文件中,加入新的设置:

<property> <name>hive.mapred.mode</name> <value>nonstrict</value> <description>The mode in which the hive operations are being performed. In strict mode, some risky queries are not allowed to run</description>
</property>
<property> <name>hive.strict.checks.cartesian.product</name> <value>false</value>
</property>

由于都是处于尝试修改错误,所以都不知道自己究竟是使用哪种方法解决了这个错误的。下次再配置hive,建议一开始就在hive-site.xml中添加上面的内容。如果还会报错,再尝试方法一!

参考链接:
hive参数hive.mapred.mode分析
一例 Hive join 优化实战----8和9两点
hive strict模式-----重点参考
How allow hive.mapred.mode=nonstrict?
hive 非等值连接, 设置hive为nonstrict模式
STRICT MODE VS NON-STRICT MODE IN HIVE OR STATIC PARTITION VS DYNAMIC PARTITION IN HIVE?

(详细)解决hive报错FAILED: SemanticException Cartesian products are disabled for safety的问题相关推荐

  1. 解决hive报错FAILED: SemanticException Cartesian products are disabled for safety的问题

    1.先看问题: FAILED: SemanticException Cartesian products are disabled for safety reasons. If you know wh ...

  2. Hive SQL 使用不了union all : SemanticException Cartesian products are disabled for safety reasons

    报错信息: SQL 错误 [40000] [42000]: Error while compiling statement: FAILED: SemanticException Cartesian p ...

  3. hive 报错 FAILED: SemanticException Cannot find class ‘com.hadoop.mapred.DeprecatedLzoTextInputFormat’

    hive 报错 FAILED: SemanticException Cannot find class 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' ...

  4. [hive 报错]:FAILED:SemanticException [Error 10025] Expression not in GROUP BY key

    问题:FAILED: SemanticException [Error 10025]: Line 104:25 Expression not in GROUP BY key 'day' 其实这个日志已 ...

  5. [hive 报错]:FAILED: SemanticException Line 0:-1 Partition not found

    问题:FAILED: SemanticException Line 0:-1 Partition not found ''19'' 这种情况一般是你创建的表是多级分区(比如day,hour),若操作时 ...

  6. 【Debugger】解决springboot报错Failed to resolve org.junit.platform:junit-platform-launcher:1.x.x的两种解决方案

    [Debugger]解决springboot报错Failed to resolve org.junit.platform:junit-platform-launcher:1.x.x的两种解决方案 主要 ...

  7. Hive报错FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask

    Hive报错Error while processing statement: FAILED: Execution Error, return code 3 from org.apache.hadoo ...

  8. 【hive报错】SemanticException Failed to breakup Windowing invocations into Groups

    背景:在hive取数中,偶然报了这个神奇的错误信息,且系统不能定位到具体地方 报错如下: SemanticException Failed to breakup Windowing invocatio ...

  9. 解决filebeat 报错 Failed to publish events

    报错日志 filebeat | 2021-12-27T17:12:03.469+0800 ERROR logstash/async.go:256 Failed to publish events ca ...

最新文章

  1. oozie 重新提交作业
  2. Java基础知识强化之IO流笔记13:递归之不死神兔问题(斐波那契数列)
  3. 三年了总觉的还是该写点什么
  4. java 泛型嵌套泛型_Java泛型嵌套
  5. Taro+react开发(46)taro中环境判断
  6. oracle sql的应用场景,oracle 3个适用sql场景
  7. 压缩js和css, IIS开启Etags, IIS开启Gzip
  8. Android开发之注解式框架ButterKnife在ADT中的设置
  9. 《CoderXiaoban》第九次团队作业:Beta冲刺与验收准备1
  10. JSONArray.fromObject(); 引入问题
  11. fastlane build 版本号自增
  12. 阿里云联合浙江大学举办首届数智服务创新挑战赛!
  13. 初识软件工程-软件工程的产生与发展
  14. 电脑安装matlab卡顿,解决 Windows 10 卡顿问题
  15. android配置阿里云仓库
  16. 我的为人处事真的有问题吗?
  17. 微信公众号怎么集赞服务器,【微信点赞】_微信怎么点赞如何集赞微信点赞活动新手必备点赞教程...
  18. 4G 物联网连接主力--- LTE Cat1
  19. FileSizeUtil
  20. 软件技术的现状以及未来发展趋势

热门文章

  1. 【Linux】创建、修改和删除用户组(groupadd | groupmod | groupdel)
  2. python是微软开发的吗_Python是如何在微软发展壮大的
  3. Keil升级到AC6后,到底有哪些变化?
  4. Android卡顿掉帧问题分析之原理篇
  5. fota 差分包_艾拉比FOTA差分升级助力电力厂商加速软件迭代
  6. [ElementPlus] 多标签页切换
  7. 无数的讽刺侮辱挖苦打击否定不屑与嘲笑,只有罗永浩才撑得住吧
  8. oracle期末考试参考答案
  9. 双非普通一本大一学生学期末课设——运动会比赛计分系统
  10. 值得看三次的高干文_值得看三次的高干文,熬夜都要看