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-22999][SQL]'show databases like command' can remove the like keyword #20194

Closed
wants to merge 1 commit into from

Conversation

guoxiaolongzte
Copy link

What changes were proposed in this pull request?

SHOW DATABASES (LIKE pattern = STRING)? Can be like the back increase?
When using this command, LIKE keyword can be removed.
You can refer to the SHOW TABLES command, SHOW TABLES 'test *' and SHOW TABELS like 'test *' can be used.
Similarly SHOW DATABASES 'test *' and SHOW DATABASES like 'test *' can be used.

How was this patch tested?

unit tests manual tests
Please review http://spark.apache.org/contributing.html before opening a pull request.

@@ -141,7 +141,7 @@ statement
(LIKE? pattern=STRING)? #showTables
| SHOW TABLE EXTENDED ((FROM | IN) db=identifier)?
LIKE pattern=STRING partitionSpec? #showTable
| SHOW DATABASES (LIKE pattern=STRING)? #showDatabases
| SHOW DATABASES (LIKE? pattern=STRING)? #showDatabases
Copy link
Member

Choose a reason for hiding this comment

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

We are following Hive. Any change was made in the recent releases of Hive?

Copy link
Author

Choose a reason for hiding this comment

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

Hive did not change, but I think spark can change the next.

Copy link
Member

Choose a reason for hiding this comment

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

@guoxiaolongzte . MySQL also doesn't work like that. Do you have any reference for that syntax?

Copy link
Author

Choose a reason for hiding this comment

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

No, I just saw like show tables like can be removed. so I think show databases like can also be removed. Just think it is removed, the operation is more convenient.

Copy link
Member

Choose a reason for hiding this comment

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

Impala is the only reference I can find https://www.cloudera.com/documentation/enterprise/5-10-x/topics/impala_show.html

To be consistent with the other SHOW function, we can make LIKE optional?

Copy link
Author

Choose a reason for hiding this comment

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

@gatorsmile @dongjoon-hyun
I think we can make LIKE optional.

@gatorsmile
Copy link
Member

OK to test

@gatorsmile
Copy link
Member

ok to test

@gatorsmile
Copy link
Member

test this please

@SparkQA
Copy link

SparkQA commented Jan 14, 2018

Test build #86120 has finished for PR 20194 at commit 26e7c0d.

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

@dongjoon-hyun
Copy link
Member

cc @hvanhovell , too.

@gatorsmile
Copy link
Member

LGTM

Thanks! Merged to master/2.3

asfgit pushed a commit that referenced this pull request Jan 14, 2018
…eyword

## What changes were proposed in this pull request?

SHOW DATABASES (LIKE pattern = STRING)? Can be like the back increase?
When using this command, LIKE keyword can be removed.
You can refer to the SHOW TABLES command, SHOW TABLES 'test *' and SHOW TABELS like 'test *' can be used.
Similarly SHOW DATABASES 'test *' and SHOW DATABASES like 'test *' can be used.

## How was this patch tested?
unit tests   manual tests
Please review http://spark.apache.org/contributing.html before opening a pull request.

Author: guoxiaolong <[email protected]>

Closes #20194 from guoxiaolongzte/SPARK-22999.

(cherry picked from commit 42a1a15)
Signed-off-by: gatorsmile <[email protected]>
@asfgit asfgit closed this in 42a1a15 Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants