Skip to content

Conversation

@gatorsmile
Copy link
Member

What changes were proposed in this pull request?

"Not good to slightly ignore all the un-supported options/clauses. We should either support it or throw an exception." A comment from @yhuai in another PR #12146

How was this patch tested?

Test cases are added to verify all the cases.

@gatorsmile
Copy link
Member Author

Let us see how many test cases will fail after the changes.

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55329 has finished for PR 12255 at commit b1774f0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55344 has finished for PR 12255 at commit 12d9167.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile gatorsmile changed the title [SPARK-14481] [SQL] [WIP] Issue Exceptions for All Unsupported Options during Parsing [SPARK-14481] [SQL] Issue Exceptions for All Unsupported Options during Parsing Apr 8, 2016
logWarning("EXPLAIN FORMATTED option is ignored.")
logWarning("Unsupported operation: EXPLAIN FORMATTED option")
}
if (options.exists(_.LOGICAL != null)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to throw an exception here. LOGICAL is more or less the opposite of EXTENDED. So I think we can safely ignore it instead of logging a warning or throwing an exception.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will remove it. Thanks!

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55361 has finished for PR 12255 at commit e98a5d3.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55357 has finished for PR 12255 at commit bb8d78b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55368 has finished for PR 12255 at commit e98a5d3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member Author

The code is ready for review. Thanks! @yhuai @andrewor14 @hvanhovell

val (table, temp, ifNotExists, external) = visitCreateTableHeader(ctx.createTableHeader)
if (external) {
logWarning("EXTERNAL option is not supported.")
throw new ParseException("Unsupported operation: EXTERNAL option", ctx)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we ignore it? In this case, we are creating data source tables. They should be EXTERNAL? right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to throw exception

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then, we should check the values in Option to determine if users should specify EXTERNAL? If it does not match, we should issue an exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/commands.scala#L141-L149 already takes care it for data source tables, right? At here, we can still just throw the exception for now because 1.6 does not support CREATE EXTERNAL TABLE ... USING.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just feel free to let me know if anything is missing in this PR. Thanks!

@SparkQA
Copy link

SparkQA commented Apr 9, 2016

Test build #55417 has finished for PR 12255 at commit 2440869.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

sql(
"""CREATE VIEW IF NOT EXISTS
|default.testView (c1 COMMENT 'blabla', c2 COMMENT 'blabla')
|COMMENT 'blabla'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, before we just output a comment when users specify comment. Now we issues an exception.
https://github.com/apache/spark/pull/12255/files#diff-1ff3f3d67da039f3cb51cc96665a9216R235

That is why I removed it. Otherwise, we are unable to create this view.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a jira for supporting that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do it. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a PR: #12288 for this missing support. Thanks!

@yhuai
Copy link
Contributor

yhuai commented Apr 9, 2016

Thanks. Merging to master.

@asfgit asfgit closed this in 9be5558 Apr 9, 2016
@gatorsmile gatorsmile deleted the warningToException branch April 9, 2016 21:58
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.

5 participants