Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14954][SQL] Add PARTITIONED BY and CLUSTERED BY clause for data source CTAS syntax - #12734
[SPARK-14954][SQL] Add PARTITIONED BY and CLUSTERED BY clause for data source CTAS syntax#12734liancheng wants to merge 5 commits into
Conversation
Also checks for metastore table properties
SparkQA
commented
Apr 27, 2016
Test build #57127 has finished for PR 12734 at commit
|
SparkQA
commented
Apr 27, 2016
Test build #57129 has finished for PR 12734 at commit
|
For UPDATE: DataFrameWriter's sortBy does require bucketBy |
| table, provider, temp, partitionColumnNames, bucketSpec, mode, options, query) | ||
| } else { | ||
| val struct = Option(ctx.colTypeList).map(createStructType) | ||
| val struct = Option(ctx.colTypeList()).map(createStructType) |
There was a problem hiding this comment.
If the command is not CTAS statement, seems we should throw exceptions if users define any of PARTITIONED BY, SORTED BY, or CLUSTERED BY clause?
There was a problem hiding this comment.
One thing that is not very related to this pr. I always find that the keyword CLUSTERED BY is very confusing, because there is a CLUSTER BY keyword (, which is DISTRIBUTE BY + SORT BY). But, we do not need to change it right now.
There was a problem hiding this comment.
I am going to add the check for this else branch and add some tests.
There was a problem hiding this comment.
oh, sorry. PARTITIONED BY and CLUSTERED BY are both associated with CREATE TABLE USING AS SELECT rule. So, for CREATE TABLE USING, if PARTITIONED BY or CLUSTERED PY is provided, we already throw an exception.
jodersky
commented
Apr 27, 2016
Does this pr fix a ticket? In that case it would be useful to change the title to include the [SPARK-] prefix so that the JIRA status gets updated |
yhuai
commented
Apr 27, 2016
Yea. https://issues.apache.org/jira/browse/SPARK-14954 is the jira. |
jodersky
commented
Apr 27, 2016
Could you change the title to |
yhuai
commented
Apr 27, 2016
oh, I cannot change it. @liancheng will change the title after he gets up :) |
yhuai
commented
Apr 27, 2016
@liancheng The last commit adds a new test. |
yhuai
commented
Apr 27, 2016
Changes look good to me. |
SparkQA
commented
Apr 27, 2016
Test build #57161 has finished for PR 12734 at commit
|
yhuai
commented
Apr 27, 2016
I fixed the title while merging to master. |
liancheng
commented
Apr 28, 2016
@jodersky Oh sorry, pasted the JIRA ticket summary to the PR title but forgot to add the tags. Updated! |
What changes were proposed in this pull request?
Currently, we can only create persisted partitioned and/or bucketed data source tables using the Dataset API but not using SQL DDL. This PR implements the following syntax to add partitioning and bucketing support to the SQL DDL:
How was this patch tested?
Test cases are added in
MetastoreDataSourcesSuiteto check the newly added syntax.