findepi commented on issue #14089:
URL: https://github.com/apache/datafusion/issues/14089#issuecomment-2585678389

   > I think the root cause is that SQL is largely case insensitive 
   
   SQL spec seems to say that unquoted (not delimited) identifiers are 
equivalent to their upper-case delimited variants (ie `abc` is equivalent to 
`"abc"`). The equivalence relation is what's used for column resolution.
   
   Quoting SQL'16 here
   
   ```
   24) For every <identifier body> IB there is exactly one corresponding 
case-normal form CNF. CNF is an
   <identifier body> derived from IB as follows:
   Let n be the number of characters in IB. For i ranging from 1 (one) to n, 
the i-th character Mi of IB is
   transliterated into the corresponding character or characters of CNF as 
follows:
   Case:
   a) If Mi is a lower case character or a title case character for which an 
equivalent upper case sequence
   U is defined by Unicode, then let j be the number of characters in U; the 
next j characters of CNF are
   U.
   b) Otherwise, the next character of CNF is Mi.
   ```
   
   ```
   28) A <regular identifier> and a <delimited identifier> are equivalent if 
the case-normal form of the <identifier
   body> of the <regular identifier> and the <delimited identifier body> of the 
<delimited identifier> (with
   all occurrences of <quote> replaced by <quote symbol> and all occurrences of 
<doublequote symbol>
   replaced by <double quote>), considered as the repetition of a <character 
string literal> that specifies a
   <character set specification> of SQL_IDENTIFIER and IDC, compare equally 
according to the comparison
   rules in Subclause 8.2, “<comparison predicate>”
   ```
   
   However, DataFusion follows PostgreSQL variant of SQL, so my interpretation 
is that our intended behavior is "like in SQL spec but lower-case".
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to