backkem commented on PR #10528:
URL: https://github.com/apache/datafusion/pull/10528#issuecomment-2116068547

   > Using the `expr_to_sql` api, we get the following error:
   > 
   > ```
   > assertion `left == right` failed
   >   left: "((\"a\" < 5) OR (\"a\" = 8))"
   >  right: "a < 5 OR a = 8"
   > ```
   
   The current unparser is somewhat conservative for correctness sake; Always 
quoting identifiers and adding every set of parentheses possible. If we want to 
make the generated SQL more succinct, these steps will have to be made 
"smarter". We'll have to add in the math rules to avoid unneeded parentheses 
and (likely dialect specific) rules for determining of quoting is needed. Note 
that the latter likely involves listing out the reserved keywords for each 
dialect.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to