Skip to content

[SPARK-3793][SQL]use HiveConf/Context when parse hive ql#2655

Closed
scwf wants to merge 1 commit intoapache:masterfrom
scwf:addconf-to-hiveql
Closed

[SPARK-3793][SQL]use HiveConf/Context when parse hive ql#2655
scwf wants to merge 1 commit intoapache:masterfrom
scwf:addconf-to-hiveql

Conversation

@scwf
Copy link
Contributor

@scwf scwf commented Oct 4, 2014

This PR is to make hive ql parser more general and compatible with both hive-0.12 and hive-0.13. In hive-0.13 we may need hiveconf(Context) when parsing a sql(quoted sql). For example, runing sql as follow without hiveconf will get NPE exception:

createQueryTest("quoted alias.attr",
"SELECT a.key FROM src a ORDER BY key LIMIT 1")
[info] - quoted alias.attr *** FAILED ***
[info] org.apache.spark.sql.hive.HiveQl$ParseException: Failed to parse: SELECT a.key FROM src a ORDER BY key LIMIT 1
[info] at org.apache.spark.sql.hive.HiveQl$.parseSql(HiveQl.scala:221)
[info] at org.apache.spark.sql.hive.test.TestHiveContext$HiveQLQueryExecution.logical$lzycompute(TestHive.scala:143)
[info] at org.apache.spark.sql.hive.test.TestHiveContext$HiveQLQueryExecution.logical(TestHive.scala:143)
[info] at org.apache.spark.sql.hive.test.TestHiveContext$QueryExecution.analyzed$lzycompute(TestHive.scala:153)
[info] at org.apache.spark.sql.hive.test.TestHiveContext$QueryExecution.analyzed(TestHive.scala:152)
[info] at org.apache.spark.sql.SQLContext$QueryExecution.optimizedPlan$lzycompute(SQLContext.scala:403)
[info] at org.apache.spark.sql.SQLContext$QueryExecution.optimizedPlan(SQLContext.scala:403)
[info] at org.apache.spark.sql.SQLContext$QueryExecution.sparkPlan$lzycompute(SQLContext.scala:407)
[info] at org.apache.spark.sql.SQLContext$QueryExecution.sparkPlan(SQLContext.scala:405)
[info] at org.apache.spark.sql.SQLContext$QueryExecution.executedPlan$lzycompute(SQLContext.scala:411)
[info] ...
[info] Cause: java.lang.NullPointerException:
[info] at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:1295)
[info] at org.apache.hadoop.hive.ql.parse.HiveLexer.allowQuotedId(HiveLexer.java:342)
[info] at org.apache.hadoop.hive.ql.parse.HiveLexer$DFA21.specialStateTransition(HiveLexer.java:10945)
[info] at org.antlr.runtime.DFA.predict(DFA.java:80)
[info] at org.apache.hadoop.hive.ql.parse.HiveLexer.mIdentifier(HiveLexer.java:7925)
[info] at org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:10818)
[info] at org.antlr.runtime.Lexer.nextToken(Lexer.java:89)
[info] at org.antlr.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:133)
[info] at org.antlr.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:127)
[info] at org.antlr.runtime.CommonTokenStream.consume(CommonTokenStream.java:70)

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@scwf scwf changed the title [SPARK-3793][SQL]use hiveconf when parse hive ql [SPARK-3793][SQL]use HiveConf/Context when parse hive ql Oct 4, 2014
@scwf
Copy link
Contributor Author

scwf commented Oct 5, 2014

It should be fixed in #2241, so close this

@scwf scwf closed this Oct 5, 2014
@scwf scwf deleted the addconf-to-hiveql branch January 7, 2015 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants