alamb commented on issue #3031: URL: https://github.com/apache/arrow-datafusion/issues/3031#issuecomment-1217787112
And we can see that as @liukun4515 says the casting is added in the physical
plan (rather than the logical plan):
```sql
❯ explain verbose select * from bar where d = 1.4;
+-------------------------------------------------------+-----------------------------------------------------------------------------------+
| plan_type | plan
|
+-------------------------------------------------------+-----------------------------------------------------------------------------------+
| initial_logical_plan | Projection: #bar.d
|
| | Filter: #bar.d =
Float64(1.4) |
| | TableScan: bar
|
| logical_plan after simplify_expressions | SAME TEXT AS ABOVE
|
| logical_plan after decorrelate_where_exists | SAME TEXT AS ABOVE
|
| logical_plan after decorrelate_where_in | SAME TEXT AS ABOVE
|
| logical_plan after decorrelate_scalar_subquery | SAME TEXT AS ABOVE
|
| logical_plan after subquery_filter_to_join | SAME TEXT AS ABOVE
|
| logical_plan after eliminate_filter | SAME TEXT AS ABOVE
|
| logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE
|
| logical_plan after eliminate_limit | SAME TEXT AS ABOVE
|
| logical_plan after projection_push_down | Projection: #bar.d
|
| | Filter: #bar.d =
Float64(1.4) |
| | TableScan: bar
projection=[d] |
| logical_plan after rewrite_disjunctive_predicate | SAME TEXT AS ABOVE
|
| logical_plan after reduce_outer_join | SAME TEXT AS ABOVE
|
| logical_plan after filter_push_down | SAME TEXT AS ABOVE
|
| logical_plan after limit_push_down | SAME TEXT AS ABOVE
|
| logical_plan after SingleDistinctAggregationToGroupBy | SAME TEXT AS ABOVE
|
| logical_plan | Projection: #bar.d
|
| | Filter: #bar.d =
Float64(1.4) |
| | TableScan: bar
projection=[d] |
| initial_physical_plan | ProjectionExec:
expr=[d@0 as d] |
| | FilterExec:
CAST(d@0 AS Decimal128(38, 15)) = CAST(1.4 AS Decimal128(38, 15)) |
| | MemoryExec:
partitions=1, partition_sizes=[1] |
| |
|
| physical_plan after aggregate_statistics | SAME TEXT AS ABOVE
|
| physical_plan after hash_build_probe_order | SAME TEXT AS ABOVE
|
| physical_plan after coalesce_batches | ProjectionExec:
expr=[d@0 as d] |
| |
CoalesceBatchesExec: target_batch_size=4096
|
| | FilterExec:
CAST(d@0 AS Decimal128(38, 15)) = CAST(1.4 AS Decimal128(38, 15)) |
| | MemoryExec:
partitions=1, partition_sizes=[1] |
| |
|
| physical_plan after repartition | ProjectionExec:
expr=[d@0 as d] |
| |
CoalesceBatchesExec: target_batch_size=4096
|
| | FilterExec:
CAST(d@0 AS Decimal128(38, 15)) = CAST(1.4 AS Decimal128(38, 15)) |
| |
RepartitionExec: partitioning=RoundRobinBatch(16) |
| |
MemoryExec: partitions=1, partition_sizes=[1] |
| |
|
| physical_plan after add_merge_exec | SAME TEXT AS ABOVE
|
| physical_plan | ProjectionExec:
expr=[d@0 as d] |
| |
CoalesceBatchesExec: target_batch_size=4096
|
| | FilterExec:
CAST(d@0 AS Decimal128(38, 15)) = CAST(1.4 AS Decimal128(38, 15)) |
| |
RepartitionExec: partitioning=RoundRobinBatch(16) |
| |
MemoryExec: partitions=1, partition_sizes=[1] |
| |
|
+-------------------------------------------------------+-----------------------------------------------------------------------------------+
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
