[ENH] Support user control over case sensitivity
See original GitHub issueSome SQL query generators make it difficult to control the upper/lower cases of columns, tables, etc in emitted SQL.
In my use case, I’m trying to avoid modifying a query that uses uppercase column names, where my table was defined w/ lower case column names. It’d be useful to allow a configuration of case sensitivity used in the SQL parsing step. It looks like this is doable in Calcite.
Test:
from dask_sql import Context
import pandas as pd
c = Context()
df = pd.DataFrame({'id': [0, 1]})
c.create_table('test', df)
c.sql("select ID from test")
Trace:
---------------------------------------------------------------------------
ParsingException Traceback (most recent call last)
/tmp/ipykernel_574321/308482520.py in <module>
4 df = cudf.DataFrame({'id': [0, 1]})
5 c.create_table('test', df)
----> 6 c.sql("select ID from test")
~/conda/envs/dsql-dask-main/lib/python3.8/site-packages/dask_sql/context.py in sql(self, sql, return_futures, dataframes)
434 self.create_table(df_name, df)
435
--> 436 rel, select_names, _ = self._get_ral(sql)
437
438 dc = RelConverter.convert(rel, context=self)
~/conda/envs/dsql-dask-main/lib/python3.8/site-packages/dask_sql/context.py in _get_ral(self, sql)
772 # if debug is not set.
773 # Instead, we raise a nice exception
--> 774 raise ParsingException(sql, str(e.message())) from None
775
776 # Internal, temporary results of calcite are sometimes
ParsingException: Can not parse the given SQL: org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 9: Column 'ID' not found in any table; did you mean 'id'?
The problem is probably somewhere here:
select ID from test
^^
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
[KEYCLOAK-2858] Case sensitive user names - Red Hat
I'm talking about this: username = *UNICODECHARNOCRLF. Which of course does not imply case sensitivity is a must, only the charset, but they...
Read more >InMemory: Enable case sensitivity/insensitivity setting #6153
Case sensitivity in SQL Server is actually controlled by the collation settings in the database. We can see the value in having similar...
Read more >Case-sensitivity and the IN function - Alteryx Community
I confirmed with Client Service that the function is not case-sensitive. Obviously there are ways around this...using a join, using findstring, ...
Read more >Case sensitivity issue between LDAP plugin and role-strategy ...
The plugin seems to make some inconsistent checks when it's an API call (bug) vs. when the user is logged in Jenkins interface...
Read more >User Control and Freedom (Usability Heuristic #3)
The ability to easily get out of trouble encourages exploration, which facilitates learning and discovery of features. It also increases overall ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah can verify that the following works for me with the latest dask-sql:
@randerzander are you sure you are using the correct version in your tests? This seems to works and is tested in https://github.com/dask-contrib/dask-sql/blob/main/tests/integration/test_compatibility.py#L940