2017-03-23 4 views
2

エラー:ステートメントをコンパイル中にエラーが発生しました:FAILED:0子(状態= 42000、コード= 40000)でSemanticExceptionが発生しました。結合条件のサブクエリのハイブサポートですか?

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) 
+0

T4? ........... –

+0

@DuduMarkovitz 26の結合がある、私はちょっとクレイジーを得ることができるように問題を引き起こしているものを置く...クエリは昇華で192行です...はい、それはユニークな目的を果たし、一度夜に実行されます。これはETLの交換用の集合体です...名前がファンキーな理由もベンダーロジック/ネーミングを使用したくない理由 –

+0

これはスタイルの発言ではありませんでした。あなたが気づいたように、 't4'はクエリで定義されていないものとして使用されました。 –

答えて

0

ハイブ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)