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

SQL identifier comparisons should ignore case (or should they) #52

Closed
joshuaauerbachwatson opened this issue Apr 30, 2017 · 0 comments
Closed
Labels

Comments

@joshuaauerbachwatson
Copy link
Contributor

We have noted that table names or column names in mixed case cause queries generated from SQL to fail. This is a combination of two things. First, our code always does 'respect case' comparisons. Second, even if you write mixed case in the SQL query, the presto parser converts all identifiers to lower case internally. Today, you have to know that this lowercasing is happening and you have to ensure that all table and column names are all lower case.

Jerome says that Presto's contribution to this problem is considered a bug by them.

There is also the fact that (1) it is surprisingly unclear what the SQL standard calls for and (2) most implementations don't adhere to any version of the SQL standard 100%. So, in practice, SQL sometimes calls for ignoring case and sometimes respecting it during comparisons. I believe the SQL 92 standard, at least, actually says that unquoted identifiers should be compared while ignoring case whereas quoted ones should be compared while respecting case.

Probably the only real solid long-term solution to this is to support both ignore-case and respect-case comparison operators in across our internal languages and identify which is called for in the front-end translation from SQL.

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

No branches or pull requests

2 participants