-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14346] SHOW CREATE TABLE for data source tables #12781
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
Changes from all commits
638be69
01af690
de8f532
2f67939
a5dc3a4
dbb9b34
ea9f6c7
87f4b18
890bcc0
baa177b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,9 @@ statement | |
| | ALTER DATABASE identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ||
| | DROP DATABASE (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase | ||
| | createTableHeader ('(' colTypeList ')')? tableProvider | ||
| (OPTIONS tablePropertyList)? #createTableUsing | ||
| (OPTIONS tablePropertyList)? | ||
| (PARTITIONED BY partitionColumnNames=identifierList)? | ||
| bucketSpec? #createTableUsing | ||
| | createTableHeader tableProvider | ||
|
||
| (OPTIONS tablePropertyList)? | ||
| (PARTITIONED BY partitionColumnNames=identifierList)? | ||
|
|
@@ -102,6 +104,7 @@ statement | |
| ((FROM | IN) db=identifier)? #showColumns | ||
| | SHOW PARTITIONS tableIdentifier partitionSpec? #showPartitions | ||
| | SHOW FUNCTIONS (LIKE? (qualifiedName | pattern=STRING))? #showFunctions | ||
| | SHOW CREATE TABLE tableIdentifier #showCreateTable | ||
| | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | ||
| | (DESC | DESCRIBE) option=(EXTENDED | FORMATTED)? | ||
| tableIdentifier partitionSpec? describeColName? #describeTable | ||
|
|
||
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.
@cloud-fan Do we allow users to specify bucketing without providing partitioning columns? Seems only
DynamicPartitionWriterContainersupport bucketSpec?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.
Yes, we do. If partition columns are empty but bucket columns are not, we will also use
DynamicPartitionWriterContainer, see: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelation.scala#L124-L136There 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.
Thanks!
Uh oh!
There was an error while loading. Please reload this page.
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.
I just realized that
OPTIONSgoes first. I am wondering if it makes sense puttingOPTIONSafterPARTITIONED BYand bucketSpec.(Update: let me ask around)
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.
Let's add tests for this syntax (right now we only have tests for show create table).