报错信息:
SQL 错误 [40000] [42000]: Error while compiling statement: 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默认出于安全考虑,不允许使用union all. 如果你知道你在干什么,可以去设置允许使用。
解决方案:
set hive.strict.checks.cartesian.product=false
set hive.mapred.mode=nonstrict
完美解决: