-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-17932][SQL] Support SHOW TABLES EXTENDED LIKE 'identifier_with_wildcards' statement #15958
Conversation
Test build #68926 has started for PR 15958 at commit |
retest this please. |
Test build #68943 has finished for PR 15958 at commit
|
cc @dilipbiswal The original code was wrote by you. Could you review it? Thanks! |
@gatorsmile Thank you for cc'ing me. Overall it looks good to me.
spark-sql> create table realtable(c1 int) using parquet;
Time taken: 0.467 seconds
spark-sql> create temporary view realview (c1 int, c2 int) using parquet;
Time taken: 0.053 seconds
spark-sql> show tables extended like 'real*';
default realtable false CatalogTable(
Table: `default`.`realtable`
Owner: cloudera
Created: Tue Nov 22 17:41:56 PST 2016
Last Access: Wed Dec 31 16:00:00 PST 1969
Type: MANAGED
Schema: [StructField(c1,IntegerType,true)]
Provider: parquet
Properties: [transient_lastDdlTime=1479865316]
Storage(Location: file:/user/hive/warehouse/realtable, InputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat, OutputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat, Serde: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe, Properties: [serialization.format=1]))
realview true CatalogTable(
Table: `realview`
Created: Tue Nov 22 17:42:28 PST 2016
Last Access: Wed Dec 31 15:59:59 PST 1969
Type: VIEW
Schema: [StructField(c1,IntegerType,true), StructField(c2,IntegerType,true)]
Storage())
Time taken: 0.104 seconds, Fetched 2 row(s)
|
@dilipbiswal Thank you for reviewing this PR! I want to share my thoughts about the questions:
|
Test build #69128 has finished for PR 15958 at commit
|
Could you update the PR title? The current one is confusing. This PR is not a bug fix. |
@gatorsmile I've updated the title, thank you! |
The |
} | ||
|
||
override def run(sparkSession: SparkSession): Seq[Row] = { | ||
if (isExtended && !tableIdentifierPattern.isDefined) { | ||
throw new AnalysisException( | ||
s"SHOW TABLES EXTENDED must have identifier_with_wildcards specified.") |
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.
Throw this exception when creating the class. This is to late.
Test build #69393 has started for PR 15958 at commit |
retest this please. |
Test build #69395 has finished for PR 15958 at commit
|
LGTM. Merging to master. Thanks! |
| SHOW TABLES ((FROM | IN) db=identifier)? | ||
(LIKE? pattern=STRING)? #showTables | ||
| SHOW TABLES EXTENDED? ((FROM | IN) db=identifier)? | ||
(LIKE? pattern=STRING)? partitionSpec? #showTables |
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.
This Syntax is different from Hive.
SHOW TABLE EXTENDED [IN|FROM database_name] LIKE 'identifier_with_wildcards' [PARTITION(partition_spec)];
@jiangxb1987 Could you submit a follow-up PR to correct it? Thanks! |
@gatorsmile Could you explicitly point out which part should be modified? IMO we don't follow the HIVE syntax unconditionally. Thanks! |
If needed, we should not break the consistency. For example, |
…_wildcards' statement ## What changes were proposed in this pull request? Currently we haven't implemented `SHOW TABLE EXTENDED` in Spark 2.0. This PR is to implement the statement. Goals: 1. Support `SHOW TABLES EXTENDED LIKE 'identifier_with_wildcards'`; 2. Explicitly output an unsupported error message for `SHOW TABLES [EXTENDED] ... PARTITION` statement; 3. Improve test cases for `SHOW TABLES` statement. ## How was this patch tested? 1. Add new test cases in file `show-tables.sql`. 2. Modify tests for `SHOW TABLES` in `DDLSuite`. Author: jiangxingbo <[email protected]> Closes apache#15958 from jiangxb1987/show-table-extended.
…_wildcards' statement ## What changes were proposed in this pull request? Currently we haven't implemented `SHOW TABLE EXTENDED` in Spark 2.0. This PR is to implement the statement. Goals: 1. Support `SHOW TABLES EXTENDED LIKE 'identifier_with_wildcards'`; 2. Explicitly output an unsupported error message for `SHOW TABLES [EXTENDED] ... PARTITION` statement; 3. Improve test cases for `SHOW TABLES` statement. ## How was this patch tested? 1. Add new test cases in file `show-tables.sql`. 2. Modify tests for `SHOW TABLES` in `DDLSuite`. Author: jiangxingbo <[email protected]> Closes apache#15958 from jiangxb1987/show-table-extended.
What changes were proposed in this pull request?
Currently we haven't implemented
SHOW TABLE EXTENDED
in Spark 2.0. This PR is to implement the statement.Goals:
SHOW TABLES EXTENDED LIKE 'identifier_with_wildcards'
;SHOW TABLES [EXTENDED] ... PARTITION
statement;SHOW TABLES
statement.How was this patch tested?
show-tables.sql
.SHOW TABLES
inDDLSuite
.