问题
要执行的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;