Basically, I want to run the following query:
select 'a\'b', case(null as Array)
However, neither HiveContext and SQLContext can execute it without
exception.
I have tried
sql(select 'a\'b', case(null as Array))
and
df.selectExpr("'a\'b'", "case(null as Array)")
Neither of them works.
Not sure what do you mean? You want to have one exactly query running fine in
both sqlContext and HiveContext? The query parser are different, why do you
want to have this feature? Do I understand your question correctly?
Yong
Date: Thu, 12 May 2016 13:09:34 +0200
Subject: SQLContext and
yep the same error I got
root
|-- a: array (nullable = true)
||-- element: integer (containsNull = false)
|-- b: integer (nullable = false)
NoViableAltException(35@[])
at
org.apache.hadoop.hive.ql.parse.HiveParser.primitiveType(HiveParser.java:38886)
at