Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/4127#discussion_r23275690
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala ---
@@ -70,9 +71,16 @@ class HiveContext(sc: SparkContext) extends
SQLContext(sc) {
if (conf.dialect == "sql") {
super.sql(sqlText)
} else if (conf.dialect == "hiveql") {
- new SchemaRDD(this,
ddlParser(sqlText).getOrElse(HiveQl.parseSql(sqlText)))
- } else {
- sys.error(s"Unsupported SQL dialect: ${conf.dialect}. Try 'sql' or
'hiveql'")
+ val ddlPlan = ddlParser(sqlText)
+ val basicPlan = try {
+ HiveQl.parseSql(sqlText)
+ } catch {
+ case e: Exception if ddlPlan.nonEmpty => ddlPlan.get
+ case e: Throwable => throw e
+ }
--- End diff --
I'm not sure I understand the logic here. We only use our parser if it
returns something and if the other parser throws an exception. I think we
probably want to uniformly return the results to describe commands, even if
there is a slight variation from hive.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]