hadoop – 即使在查询中存在分区谓词时,也没有为Alias找到分区谓词

我在hdfs中有一个表pos.pos_inv,由yyyymm分区.以下是查询:

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

我已将查询的分区值提供为201501,但仍然出现错误“

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

(schema)分区,yyyymm是int类型,actvydt是日期存储为字符串类型.

最佳答案
这是因为配置单元设置为严格模式.
这允许分区表访问hdfs中的相应分区/文件夹.

  set hive.mapred.mode=unstrict;  it will work 

转载注明原文:hadoop – 即使在查询中存在分区谓词时,也没有为Alias找到分区谓词 - 代码日志