How to fix partition predicate error without using (set hive.mapred.mode=unstrict)

Viewed 3131

Is there any way to bypass Hive query when strict mode is enabled in partition table without using set hive.mapred.mode=unstrict

I have two tables both are partitioned with dte, when I do union operation on both tables and trying to select 2 where conditions I am getting partition predicate error

Query

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';

Error

Error: Error while compiling statement: FAILED: SemanticException [Error 10041]: No partition predicate found for Alias "table_one" Table "table_one" (state=42000,code=10041)

0 Answers
Related