If I run the following in spark 1.6 it works fine, but in spark 2.2 I am getting the following error. Anyone know why and how to fix the syntax?
sqlContext.sql("SELECT a.* FROM table1 a Lateral View explode(attributes) attributes_table as attributesfull inner join table2 c ON a.iID = c.iID")
org.apache.spark.sql.catalyst.parser.ParseException:
mismatched input 'inner' expecting {<EOF>, ',', 'WHERE', 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'LATERAL', 'WINDOW', 'UNION', 'EXCEPT', 'MINUS', 'INTERSECT', 'SORT', 'CLUSTER', 'DISTRIBUTE'}(line 1, pos 92)
== SQL ==
SELECT a.* FROM table1 a Lateral View explode(attributes) attributes_table as attributesfull inner join table2 c ON a.iID = c.iID
---------------------------------------------------------------------------------------------^^^
at org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:217)
at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:114)
at org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:48)
at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:68)
at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:637)
at org.apache.spark.sql.SQLContext.sql(SQLContext.scala:691)
... 50 elided
I'm thinking i can maybe get around it by using a table just for the exploded values and joining to that but would like to know why it no longer works or any better ideas.