Hive 使用问题集锦

1. hive 本身缺陷在查询的时候需要给子查询赋别名。例子如下:

查询:

select a,b,c

  from (select a,b,c
          from (select a,b,c
                  from table) a
         where rno = 1) 

 group by a;

报错:FAILED: ParseException line 10:7 missing EOF at 'by' near 'group'

原因:hive本身缺陷,需要在每个子查询后面加别名。

改正:

 select a,b,c

  from (select a,b,c
          from (select a,b,c
                  from table) a
         where rno = 1) tb

 group by a;

原文地址:https://www.cnblogs.com/txfsheng/p/9018706.html