Error while compiling statement: FAILED: SemanticException Cartesian products are disabled for .....

问题

要执行的sql(需求:显示所有可能的比赛组合)

select a.name,b.name from problem3 a, problem3 b where a.name < b.name;

报错:

[5] J. K. Author, Title of the Report, Report No., month, year.
SQL 错误 [40000] [42000]: Error while compiling statement: 
FAILED: SemanticException Cartesian products are disabled for safety reasons. 
If you know what you are doing, 
please set hive.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默认不让你笛卡儿积,这个代价太大,数据量会很大。

set hive.strict.checks.cartesian.product = false;
set hive.mapred.mode = nostrict;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值