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/11/14 07:12:32 UTC

[GitHub] [arrow-datafusion] Jefffrey commented on issue #2125: Support type cast in union

Jefffrey commented on issue #2125:
URL: https://github.com/apache/arrow-datafusion/issues/2125#issuecomment-1313195720

   Seems to be resolved as of master 96512ac05df40deb42632992cece656842d6debb
   
   Running on datafusion-cli:
   
   ```sql
   DataFusion CLI v14.0.0
   ❯ SELECT 1 as NUMBER union SELECT '1';
   +--------+
   | number |
   +--------+
   | 1      |
   +--------+
   1 row in set. Query took 0.007 seconds.
   ❯ explain verbose SELECT 1 as NUMBER union SELECT '1';
   +------------------------------------------------------------+-----------------------------------------------------------------------------------+
   | plan_type                                                  | plan                                                                              |
   +------------------------------------------------------------+-----------------------------------------------------------------------------------+
   | initial_logical_plan                                       | Distinct:                                                                         |
   |                                                            |   Union                                                                           |
   |                                                            |     Projection: CAST(Int64(1) AS Utf8) AS number                                  |
   |                                                            |       EmptyRelation                                                               |
   |                                                            |     Projection: Utf8("1") AS number                                               |
   |                                                            |       EmptyRelation                                                               |
   | logical_plan after inline_table_scan                       | SAME TEXT AS ABOVE                                                                |
   | logical_plan after type_coercion                           | SAME TEXT AS ABOVE                                                                |
   | logical_plan after simplify_expressions                    | Distinct:                                                                         |
   |                                                            |   Union                                                                           |
   |                                                            |     Projection: Utf8("1") AS number                                               |
   |                                                            |       EmptyRelation                                                               |
   |                                                            |     Projection: Utf8("1") AS number                                               |
   |                                                            |       EmptyRelation                                                               |
   | logical_plan after unwrap_cast_in_comparison               | SAME TEXT AS ABOVE                                                                |
   ...
   | logical_plan after projection_push_down                    | SAME TEXT AS ABOVE                                                                |
   | logical_plan                                               | Distinct:                                                                         |
   |                                                            |   Union                                                                           |
   |                                                            |     Projection: Utf8("1") AS number                                               |
   |                                                            |       EmptyRelation                                                               |
   |                                                            |     Projection: Utf8("1") AS number                                               |
   |                                                            |       EmptyRelation                                                               |
   ...
   54 rows in set. Query took 0.005 seconds.
   ❯
   ```
   
   Probably fixed by https://github.com/apache/arrow-datafusion/pull/3407?


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