0

Hello I have a hive query which contains a NOT IN clause. When I am trying to run this query in SPARK-SQL , it is giving me an unsupoported functionality exception.

Select A.primary_key,A.name,A.salary from spark.old A where A.primary_key NOT IN (Select B.primary_key from new B) UNION ALL Select C.primary_key,C.name,C.salary from spark.new C

Any other way to write this query? UNION ALL is working perfectly.

Aviral Kumar
  • 814
  • 1
  • 15
  • 40
  • Are you using `HiveContext` or `SQLCOntext`? – Sumit Feb 19 '16 at 08:01
  • hivecontext..its an hive query Sumit – Aviral Kumar Feb 19 '16 at 08:53
  • `Not In` is not supported in Hive. This [Link](http://stackoverflow.com/questions/16804433/hive-doesnt-support-in-exists-how-do-i-write-the-following-query) will help you to rewrite your Hive Query. or may be you can get some sample values of your structure and I can provide your correct Syntax. – Sumit Feb 19 '16 at 09:12
  • Possible duplicate of [Why SparkSQL doesn't support subquery?](http://stackoverflow.com/questions/33933118/why-sparksql-doesnt-support-subquery) – zero323 Feb 19 '16 at 13:44

0 Answers0