Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-14294] [SQL] native support alter table ... rename to ... #12086

Closed
wants to merge 3 commits into from
Closed

[SPARK-14294] [SQL] native support alter table ... rename to ... #12086

wants to merge 3 commits into from

Conversation

bomeng
Copy link
Contributor

@bomeng bomeng commented Mar 31, 2016

What changes were proposed in this pull request?

This PR addresses one of the tokens defined in SPARK-14129 (TOK_ALTERTABLE_RENAME):

Supports native execution of ALTER TABLE .. RENAME TO ... command

Syntax:

ALTER TABLE table_name RENAME TO new_table_name;

How was this patch tested?

New tests were added to DDLSuite.scala and SQLQuerySuite.scala, as well as updated DDLCommandSuite.scala.

@hvanhovell
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Mar 31, 2016

Test build #2716 has finished for PR 12086 at commit 46c7e81.

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

@hvanhovell
Copy link
Contributor

@bomeng could you add the SQL tag to the PR title. This makes it easier for others to scan the PR queue.

Overall this looks pretty solid. Could you rebase/merge to the latest master (the ANTLR 3 parser has been removed today)?

@bomeng bomeng changed the title [SPARK-14294] native support alter table ... rename to ... [SPARK-14294] [SQL] native support alter table ... rename to ... Mar 31, 2016
sparkContext.parallelize(1 to 10).toDF("num")
df.write.format("parquet").save(path)
// create the temporary table
sql(s"CREATE TEMPORARY TABLE test1 USING parquet OPTIONS (path '$path')")
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets not create a parquet file. It is easer to use org.apache.spark.sql.sources.DDLScanSource (test class). This is easier to setup and isn't writing to disk. This would become somthing like:

CREATE TEMPORARY TABLE test1 
USING org.apache.spark.sql.sources.DDLScanSource
OPTIONS (From '1', To '10', Table 'Test')

@andrewor14
Copy link
Contributor

@bomeng I happen to be working on the broader issue SPARK-14129. Would you mind if I take over this patch and build mine on top of your changes here?

@bomeng
Copy link
Contributor Author

bomeng commented Mar 31, 2016

Not a problem. @andrewor14 Hope this solution help. Thanks.

@bomeng
Copy link
Contributor Author

bomeng commented Mar 31, 2016

@hvanhovell I've updated the codes based on your comments. I will let @andrewor14 take over my codes for his task. Thanks.

@andrewor14
Copy link
Contributor

Thanks @bomeng, I will post the PR shortly.

@DeepSparkBot
Copy link

Detected duplicate issue.

@bomeng Please close this PR because the parent issue is a duplicate.

@bomeng bomeng closed this Apr 6, 2016
@bomeng bomeng deleted the SPARK-14294 branch April 27, 2016 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants