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/06/22 06:41:30 UTC

[GitHub] [arrow-datafusion] liukun4515 commented on issue #2759: InList Expr: expr and list values must can be convert to a same data type

liukun4515 commented on issue #2759:
URL: https://github.com/apache/arrow-datafusion/issues/2759#issuecomment-1162708027

   In the datafusion, we can convert NULL value of the NULL type to any other NULL value of data type.
   For example: Convert NULL(NULL) to INT32(NULL) or FLOAT(NULL);
   ❯ EXPLAIN select cast(NULL as FLOAT);
   +---------------+------------------------------------------------------+
   | plan_type     | plan                                                 |
   +---------------+------------------------------------------------------+
   | logical_plan  | Projection: Float32(NULL) AS CAST(NULL AS Float32)   |
   |               |   EmptyRelation                                      |
   | physical_plan | ProjectionExec: expr=[NULL as CAST(NULL AS Float32)] |
   |               |   EmptyExec: produce_one_row=true                    |
   |               |                                                      |
   +---------------+------------------------------------------------------+
   2 rows in set. Query took 0.002 seconds.
   ❯ EXPLAIN select cast(NULL as INT);
   +---------------+----------------------------------------------------+
   | plan_type     | plan                                               |
   +---------------+----------------------------------------------------+
   | logical_plan  | Projection: Int32(NULL) AS CAST(NULL AS Int32)     |
   |               |   EmptyRelation                                    |
   | physical_plan | ProjectionExec: expr=[NULL as CAST(NULL AS Int32)] |
   |               |   EmptyExec: produce_one_row=true                  |
   |               |                                                    |
   +---------------+----------------------------------------------------+


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