adriangb commented on code in PR #20065:
URL: https://github.com/apache/datafusion/pull/20065#discussion_r2743037874


##########
datafusion/sqllogictest/test_files/projection_pushdown.slt:
##########
@@ -941,10 +956,9 @@ logical_plan
 03)----Filter: simple_struct.id > Int64(2)
 04)------TableScan: simple_struct projection=[id, s], 
partial_filters=[simple_struct.id > Int64(2)]
 physical_plan
-01)ProjectionExec: expr=[__common_expr_1@0 + __common_expr_1@0 as doubled]
-02)--ProjectionExec: expr=[get_field(s@0, value) as __common_expr_1]
-03)----FilterExec: id@0 > 2, projection=[s@1]
-04)------DataSourceExec: file_groups={1 group: 
[[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/projection_pushdown/simple.parquet]]},
 projection=[id, s], file_type=parquet, predicate=id@0 > 2, 
pruning_predicate=id_null_count@1 != row_count@2 AND id_max@0 > 2, 
required_guarantees=[]
+01)ProjectionExec: expr=[get_field(s@0, value) + get_field(s@0, value) as 
doubled]

Review Comment:
   This is actually correct / an improvement. We are saying that `get_field` is 
very cheap, so no need to deduplicate it. I added an extra test above that 
shows that a more complex expression (`id + s['value']`) will get dudplicated 
(as a whole) by the CSE optimizer.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to