Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

| SHOW TBLPROPERTIES table=tableIdentifier
('(' key=tablePropertyKey ')')? #showTblProperties
| SHOW COLUMNS (FROM | IN) tableIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,10 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {
sql("SHOW DATABASES LIKE '*db1A'"),
Row("showdb1a") :: Nil)

checkAnswer(
sql("SHOW DATABASES '*db1A'"),
Row("showdb1a") :: Nil)

checkAnswer(
sql("SHOW DATABASES LIKE 'showdb1A'"),
Row("showdb1a") :: Nil)
Expand Down