Hive:无法执行带限制的联合查询
Hive: Cant perform union query with limit
我正在尝试 运行 在配置单元中合并所有查询
select * from tabName where col1='val1' and col2 = 'val2' limit 10 union all select * from tabName where col1='val1' and col2 = 'val3' limit 10;
但我明白了
FAILED: ParseException line 1:105 missing EOF at 'union' near '10'
我也试过了
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) as a union all ( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) as b;
但是我得到了
FAILED: ParseException line 1:109 missing EOF at 'as' near ')'
我做错了什么?
使用子查询中的 select:
select * from
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) a
union all
select * from
( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) b;
我正在尝试 运行 在配置单元中合并所有查询
select * from tabName where col1='val1' and col2 = 'val2' limit 10 union all select * from tabName where col1='val1' and col2 = 'val3' limit 10;
但我明白了
FAILED: ParseException line 1:105 missing EOF at 'union' near '10'
我也试过了
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) as a union all ( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) as b;
但是我得到了
FAILED: ParseException line 1:109 missing EOF at 'as' near ')'
我做错了什么?
使用子查询中的 select:
select * from
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) a
union all
select * from
( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) b;