在分区表中启用严格模式而不使用set hive.mapred.mode=unstrict
我有两个表都用dte分区,当我在两个表上进行联合操作并尝试选择2条件时我得到分区谓词错误
查询
with a as (select "table1" as table_name,column1,column2,column3 from table_one
union all
select "table2" as table_name,column1,column2,column3 from table_two)
select * from a where dte='2017-08-01' and table_name='table1';
错误
错误:编译语句时出错:FAILED:SemanticException [错误10041]:找不到Alias" table_one"的分区谓词 表" table_one" (状态= 42000,代码= 10041)