SemanticException Cartesian products are disabled for safety reasons. If you know what you are doin

 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. (state=42000,code=40000)

 

这个是为防止大数据集群稳定性,类似非全等join(非inner join)是禁止的,禁用了SemanticException笛卡尔产品。如果您知道自己在做什么,请将hive.strict.checks.cartesian.product设置为false,并且hive.mapred.mode未设置为“strict”以继续。请注意,如果在使用某些不安全功能时出错,则可能会得到错误或不正确的结果。(州=42000,代码=40000)

set hive.strict.checks.cartesian.product=flase;

set hive.mapred.mode=nonstrict;

 

一,

>set hive.strict.checks.cartesian.product=flase;

设置是否严格检查笛卡尔积操作,当设置为flase的时候是不严格,可以笛卡尔积操作,类似join,

反之当设置为true的时候不可以笛卡尔积操作,不能join

二,

>set hive.mapred.mode=nonstrict;是非严格模式

如果设置为strict(严格模式),有三个影响

1.在order by 的时候必须使用limit限制输出条数,因为hivesql跟传统的sql一样,都会做全局排序,但是hive的底层是MR,为保证顺序性order by会将数据都交给一个reducer。这样会造成数据倾斜不出数据,因此严格模式必须使用limit提升性能,同时跟传统的sql唯一的区别是mysql可以不用limit

2.在分区表里,必须使用分区,多分区的指定一个分区也行,

3.在使用join语句的时候,必须使用on。标配join...on...,left  join..on...

  • 4
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值