line cannot recognize input near ';' '' '' in expression specification (HQL报错)

%hive

Create table table1 stored as orc as 
SELECT p3.*
from(SELECT p2.*
   ,row_number() over(PARTITION BY p2.id ORDER BY p2.find DESC) rf
  FROM (SELECT p1.*
    , row_number() over(PARTITION BY find ORDER BY time DESC) rn
           FROM table2 p1
           WHERE time < '2018-11-01'
     ) p2
  WHERE rn = 1
)p3
where p3.rf = 1
AND p3.status = 11;

报错返回语句:

line 13:24 cannot recognize input near ';' '' '' in expression specification

错误原因:
最后一行的 ; 导致的

解决方案:
删除最后一行的 ;

你可能感兴趣的:(Hive)