Skip to content

fix:Dynamically introduce INFORMATION_SCHEMA_NAME into DruidMeta's sql statement#12384

Closed
huyuanfeng2018 wants to merge 1 commit intoapache:masterfrom
huyuanfeng2018:fix-informationschema-connect-error
Closed

fix:Dynamically introduce INFORMATION_SCHEMA_NAME into DruidMeta's sql statement#12384
huyuanfeng2018 wants to merge 1 commit intoapache:masterfrom
huyuanfeng2018:fix-informationschema-connect-error

Conversation

@huyuanfeng2018
Copy link

Description

When I modify the INFORMATION_SCHEMA_NAME value in DruidCalciteSchemaModule (possibly for compatibility with other databases that support sql, such as changing uppercase to lowercase), the following error will be reported when using jdbc to connect to druid:
Object 'INFORMATION_SCHEMA' not found; did you mean 'information_schema'?

Fixed the bug ...

Modify the sql statement in the DruidMeta.java class, in which the hard-written INCOMPLETE_SCHEMA table name is changed to dynamic application



This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@huyuanfeng2018 huyuanfeng2018 changed the title fix fix:Dynamically introduce INFORMATION_SCHEMA_NAME into DruidMeta's sql statement Apr 1, 2022
@paul-rogers
Copy link
Contributor

The change itself seems fine: creating a constant for the information schema name. +1 (non-binding) on that change.

The PR description suggests that this change is made in the context of changing the schema name. The challenge is that, unlike a typical RDBMS, Druid SQL identifiers are case sensitive. So, Druid only knows about this item if the name is upper case: INFORMATION_SCHEMA.

The reason it is upper-case, it turns out, is that INFORMATION_SCHEMA is a SQL-92 feature, and the spec says that the name must be upper case. In a case-insensitive DB, this doesn't matter. But, in Druid, it does.

Given that the standard says the name must be upper case, I wonder which DB (or client library) expects the name to be lower case?

@github-actions
Copy link

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 11, 2023
@github-actions
Copy link

github-actions bot commented Jan 9, 2024

This pull request/issue has been closed due to lack of activity. If you think that
is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Jan 9, 2024
@huyuanfeng2018 huyuanfeng2018 deleted the fix-informationschema-connect-error branch March 20, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants