严格模式
是什么:防止可能出现不好的结果
防止出现三种场景:
- 分区表查询中没有写where分区过滤条件
- orderby 中没有写limit
- 不允许出现笛卡尔积
hive.mapred.mode值为默认是非严格模式nonstrict 。
怎么用:
修改hive.mapred.mode值为strict,
<property>
<name>hive.mapred.mode</name>
<value>strict</value>
<description>
The mode in which the Hive operations are being performed.
In strict mode, some risky queries are not allowed to run. They include:
Cartesian Product.
No partition being picked up for a query.
Comparing bigints and strings.
Comparing bigints and doubles.
Orderby without limit.
</description>
</property>