sqlhadoophive

Unsupported SubQuery Expression : Correlating expression cannot contain unqualified column references


In Hive the following query fails :

  Select a,b,c from t1 where a in (0,100) AND b in (select b from t2
  where d>2 GROUP BY 1 ) LIMIT 1;

Schema :

t1(a,b,c)
t2(b,d,e)

Error log :

Unsupported SubQuery Expression 'b': Correlating expression cannot contain unqualified column references.

What is correlating expression? what are unqualified column references ? and can you generalize the error here ..


Solution

  • You can find someone having the same problem here and the corresponding JIRA ticket.

    Based on those answers, I would advise you to try :

    Select a,b,c from t1 where a in (0,100) AND t1.b in (select b from t2
      where d>2 GROUP BY 1 ) LIMIT 1;