You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/06 20:34:19 UTC

[GitHub] [arrow-datafusion] Dandandan opened a new issue #279: Wrap unnamed expressions in alias, improve display unnamed expressions

Dandandan opened a new issue #279:
URL: https://github.com/apache/arrow-datafusion/issues/279


   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   To support optimizations like constant folding the column names need to keep consistent.
   
   This is already visible at the (limited) constant folding we have:
   ```
   > SELECT TRUE = TRUE;
   +---------------+
   | Boolean(true) |
   +---------------+
   | true          |
   +---------------+
   1 rows in set. Query took 0 seconds.
   ```
   
   Expected is `TRUE = TRUE` (PostgreSQL) or `Boolean(true) Eq Boolean(true)` (as is used currently).
   
   **Describe the solution you'd like**
   Wrap unnamed expressions in the original. This can be updated in the `sql_expr_to_logical_expr` function in the `/datafusion/src/sql/planner.rs`
   PostgreSQL keeps the original (textual) expression with original spacing - that seems currently not feasible as sqlparser is not lossy - but we can use the formatted representation of a `SQLExpr`.
   
   **Describe alternatives you've considered**
   Keep it as is - here the column names would changed based on the applied optimizations. This is however not consistent with PostgreSQL and other databases and confusing.
   
   **Additional context**
   https://github.com/apache/arrow-datafusion/issues/237


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

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