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

Identifiers should be case-sensitive for all protocols by default #442

Closed
jiacai2050 opened this issue Dec 1, 2022 · 0 comments · Fixed by #641
Closed

Identifiers should be case-sensitive for all protocols by default #442

jiacai2050 opened this issue Dec 1, 2022 · 0 comments · Fixed by #641
Labels
A-SQL Area: SQL layer breaking-change Contains user-facing changes feature New feature or request

Comments

@jiacai2050
Copy link
Contributor

jiacai2050 commented Dec 1, 2022

Describe This Problem

In current implementation, we delegate SQL execution to DataFusion, it will automatically convert identifiers to lower case if not quoted, this behavior is what other DBMS does.

But for SQL besides SELECT, identifiers are unchanged no matter whether they are quoted, this cause conflict when

  • CREATE/INSERT table with uppercase letter, such as Test
  • Then SELECT like select * from Test will cause error since no table named test exists

Proposal

Convert identifiers without quoted to lower case for all SQL

After some discussion, proposal above doesn't make much sense in practical. The reason is that there are other protocols support(gRPC) in CeresDB, and they are case-sensitive by default, if we want to keep them consistent with SQL layer, then we need to convert ALL identifiers without quote to lower-case, which is hard to maintain, and may introduce bug when new interface is added without normalized identifiers, so I suggest

All protocols in CeresDB are case-sensitive by default(with or without quote)

In this way, we only need to modify statements passed to DataFusion, all other interface stay the same with before.

  • This may not consistent with other DBMS, but I think it will cause less confusion for CeresDB users.

Additional Context

@jiacai2050 jiacai2050 added feature New feature or request A-SQL Area: SQL layer breaking-change Contains user-facing changes labels Dec 1, 2022
@jiacai2050 jiacai2050 changed the title Identifiers should be case-insensitive for all SQL by default Unquoted identifiers should be case-insensitive for all SQL by default Dec 1, 2022
@jiacai2050 jiacai2050 changed the title Unquoted identifiers should be case-insensitive for all SQL by default Identifiers should be case-sensitive for all protocols by default Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-SQL Area: SQL layer breaking-change Contains user-facing changes feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant