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
Conversation
ok to test |
Test build #2716 has finished for PR 12086 at commit
|
@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)? |
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')") |
There was a problem hiding this comment.
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')
@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? |
Not a problem. @andrewor14 Hope this solution help. Thanks. |
@hvanhovell I've updated the codes based on your comments. I will let @andrewor14 take over my codes for his task. Thanks. |
Thanks @bomeng, I will post the PR shortly. |
Detected duplicate issue. @bomeng Please close this PR because the parent issue is a duplicate. |
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.