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 2022/09/01 12:27:27 UTC

[GitHub] [arrow-datafusion] andygrove opened a new issue, #3326: Change physical expression name for `CAST` expressions

andygrove opened a new issue, #3326:
URL: https://github.com/apache/arrow-datafusion/issues/3326

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   
   DataFusion differs from Spark and Postgres in the naming of CAST expressions. Spark and Postgres casts do not rename the column.
   
   ## Spark
   
   ```
   scala> spark.sql("select id*2, cast(id as string), name from t").show()
   +--------+---+-----+
   |(id * 2)| id| name|
   +--------+---+-----+
   |       2|  1|hello|
   |       4|  2|    x|
   +--------+---+-----+
   ```
   
   ## Postgres
   
   ```
   postgres=# select id*2, cast(id as varchar(12)), name from t1;
    ?column? | id | name 
   ----------+----+------
           2 | 1  | x
   ```
   
   ## DataFusion
   
   ```
   ❯ select id*2, cast(id as varchar(12)), name from test;
   +---------------------------+-----------------------+-------+
   | test.id Multiply Int64(2) | CAST(test.id AS Utf8) | name  |
   +---------------------------+-----------------------+-------+
   | 2                         | 1                     | hello |
   +---------------------------+-----------------------+-------+
   ```
   
   **Describe the solution you'd like**
   cast should not change expression name in results
   
   **Describe alternatives you've considered**
   None
   
   **Additional context**
   None
   


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] alamb closed issue #3326: `CAST` should not change the name of an expression

Posted by GitBox <gi...@apache.org>.
alamb closed issue #3326: `CAST` should not change the name of an expression
URL: https://github.com/apache/arrow-datafusion/issues/3326


-- 
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-unsubscribe@arrow.apache.org

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