The section predicate was not found for the alias, even if the section predicate present in the request

I have a pos.pos_inv table in hdfs which is split by yyyymm. The following is the request:

select DATE_ADD(to_date(from_unixtime(unix_timestamp(Inv.actvydt, 'MM/dd/yyyy'))),5), to_date(from_unixtime(unix_timestamp(Inv.actvydt, 'MM/dd/yyyy'))),yyyymm from pos.pos_inv inv INNER JOIN pos.POSActvyBrdg Brdg ON Brdg.EIS_POSActvyBrdgId = Inv.EIS_POSActvyBrdgId where to_date(from_unixtime(unix_timestamp(Inv.nrmlzdwkenddt, 'MM/dd/yyyy'))) BETWEEN DATE_SUB(to_date(from_unixtime(unix_timestamp(Inv.actvydt, 'MM/dd/yyyy'))),6) and DATE_ADD(to_date(from_unixtime(unix_timestamp(Inv.actvydt, 'MM/dd/yyyy'))),6) and inv.yyyymm=201501 

I provided the section value for the request as 201501, but still I get the error "

  Error while compiling statement: FAILED: SemanticException [Error 10041]: No partition predicate found for Alias "inv" Table "pos_inv" 

(schema) Section, yyyymm is an int type, and actvydt is a date stored as a string type.

+7
source share
2 answers

This is because the hive is installed in strict mode. this allows the partition table to access the corresponding partition / folder in hdfs.

  set hive.mapred.mode=unstrict; it will work 
+11
source

Your query error says: no split predicate found for Alias โ€‹โ€‹"inv" Table "pos_inv".

So, you should put the where clause for the fields of the partitioned table (for pos_inv), and not for the other (inv), as you did.

+1
source

All Articles