2

错误:编译语句时出错:失败:SemanticException 遇到 0 个孩子(状态 = 42000,代码 = 40000)

我是否需要找到解决方案来使子查询脱离 on 条件?

select
-- a bunch of stuff min,max,sum and case statements
from tbl0 t0
inner join tbl4  t4  on (t4.aKey = t0.aKey)  
left outer join tbl1  t1  on (t0.col0 = t1.col0 and t1.someKey in (select t3.aKey from tbl3 t3 where t3.someCode in ('A1','A2','A3')))
where
not(t4.aCode in ('string1' , 'strin2' , 'string3' , 'string4') and t1.someKey is null) and not (t4.bCode in ('string1' , 'string2') and t1.someCol = 0)
4

1 回答 1

0

我在 Hive 1.1 中也遇到了这个错误。

我认为 Ashish Singh 可能有最好的建议:通过在该表定义中移动 IN (SELECT ...) 语句将 tbl1 更改为子查询。

您的查询将变为:

select -- a bunch of stuff min,max,sum and case statements from tbl0 t0 inner join tbl4 t4 on (t4.aKey = t0.aKey) left outer join (SELECT col0 FROM tbl1 WHERE somekey IN (SELECT t3.aKey FROM tbl3 t3 WHERE t3.someCode in ('A1','A2','A3'))) t1 on (t0.col0 = t1.col0) where not(t4.aCode in ('string1' , 'strin2' , 'string3' , 'string4') and t1.someKey is null) and not (t4.bCode in ('string1' , 'string2') and t1.someCol = 0)

于 2018-02-08T19:49:51.517 回答