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

[FLINK-31481][table] Support enhanced show databases syntax #23612

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

jeyhunkarimov
Copy link
Contributor

What is the purpose of the change

Support enhanced show functions syntax described in FLIP-297

Brief change log

Changelog from:

SHOW DATABASES

to:

SHOW DATABASES [ ( FROM | IN ) catalog_name] [ [NOT] (LIKE | ILIKE) <sql_like_pattern> ]

Verifying this change

  • Extended integration tests flink-table/flink-sql-client/src/test/resources/sql/catalog_database.q
  • Extended unit test flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java -> testShowDataBases()
  • Added unit tests in flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlOtherOperationConverterTest.java -> testShowDatabases()

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 28, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@jeyhunkarimov
Copy link
Contributor Author

Hi @MartijnVisser could you please check this PR?

@jeyhunkarimov
Copy link
Contributor Author

Hi @jnh5y @dawidwys , could you guys check this PR?

@jnh5y
Copy link
Contributor

jnh5y commented Nov 27, 2023

This is looking pretty good. Since implementing FLIP-297 is assigned to @chucheng92, we should get his input as well!

@jeyhunkarimov have you signed up for the Flink JIRA? You may need to request access on the Flink dev list. (I tried to find instructions, but I am not seeing them immediately.)

@chucheng92
Copy link
Member

This is looking pretty good. Since implementing FLIP-297 is assigned to @chucheng92, we should get his input as well!

@jeyhunkarimov have you signed up for the Flink JIRA? You may need to request access on the Flink dev list. (I tried to find instructions, but I am not seeing them immediately.)

@jeyhunkarimov good work! Currently i'm busy with other work, feel free to assign to yourself.

@jeyhunkarimov jeyhunkarimov force-pushed the FLINK-31481 branch 2 times, most recently from ad52b5f to 78cafaf Compare November 29, 2023 06:26
@jeyhunkarimov
Copy link
Contributor Author

Thanks for the comment @chucheng92 and thank you for the review @jnh5y .

I addressed your comments. Could you please check if you have any other comments?

P.s I have jira account (jID: jeyhunkarimov). I can assign tasks to myself in other apache projects (e.g., kafka). However, in Flink this is not possible. I will ask for the required permissions via dev mailing list.

@jeyhunkarimov
Copy link
Contributor Author

Hi @jnh5y could you please check if your comments are addressed? Thanks!

if (this.catalogName != null && this.catalogName.names.size() > 1) {
throw new ParseException(
String.format(
"Show databases from/in identifier [ %s ] format error, catalog cannot contain dot character.",
Copy link
Contributor

Choose a reason for hiding this comment

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

As something that I'm unsure about... I wonder if a catalog name can contain a . if it quoted with backticks.

If so, then this statement is inaccurate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you can quote any character.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given the responses, could you please update the exception to e.g.

"Show databases from/in identifier [ %s ] format error, catalog must be a single part identifier."

@jnh5y
Copy link
Contributor

jnh5y commented Dec 18, 2023

Hi @jnh5y could you please check if your comments are addressed? Thanks!

Hi @jeyhunkarimov, sorry to be slow to look again. Things are looking good. @dawidwys would you be willing to take a quick read through. I've left some comments where I think you could provide some insight about what needs to change for this work to be merged.

@dawidwys dawidwys self-assigned this Dec 18, 2023
Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

Thank you @jeyhunkarimov for the work! The PR looks really good! I put some small comments. I think we can get it in shortly!

@jeyhunkarimov jeyhunkarimov force-pushed the FLINK-31481 branch 2 times, most recently from 4e8b7e5 to 652a9cf Compare January 8, 2024 21:41
@jeyhunkarimov
Copy link
Contributor Author

@flinkbot run azure

@jeyhunkarimov jeyhunkarimov force-pushed the FLINK-31481 branch 5 times, most recently from e889b90 to 633fd8d Compare January 11, 2024 17:11
Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

The changes look good. There is one last comment to be addressed and I'll merge the PR. Thank you @jeyhunkarimov

if (this.catalogName != null && this.catalogName.names.size() > 1) {
throw new ParseException(
String.format(
"Show databases from/in identifier [ %s ] format error, catalog cannot contain dot character.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the responses, could you please update the exception to e.g.

"Show databases from/in identifier [ %s ] format error, catalog must be a single part identifier."

Copy link
Contributor

@dawidwys dawidwys left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants