You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
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
Test
select * from Test
will cause error since no table namedtest
existsProposal
Convert identifiers without quoted to lower case for all SQLAfter 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
In this way, we only need to modify statements passed to DataFusion, all other interface stay the same with before.
Additional Context
The text was updated successfully, but these errors were encountered: