2

Error: Error while compiling statement: FAILED: SemanticException in encountered with 0 children (state=42000,code=40000)

Do I need to find a solution to getting the subquery out of the on condition?

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)
AM_Hawk
  • 661
  • 1
  • 15
  • 33

1 Answers1

0

I'm also getting this error in Hive 1.1.

I think Ashish Singh likely has the best suggestion: change tbl1 to a subquery by moving the IN (SELECT ...) statement inside of that table definition.

Your query would then become:

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)

Ward W
  • 640
  • 6
  • 14