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

   > > 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.
   
   Thank you for that excellent explanation @backkem . Since this has now come 
up several times, I filed https://github.com/apache/datafusion/issues/10557 to 
track it


-- 
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