pepijnve commented on issue #25329:
URL: https://github.com/apache/datafusion/issues/25329#issuecomment-5700068053

   With a minor change to `extract_leaf_expressions` I was able to get to
   
   ```
   after extract_leaf_expressions   | Projection: t.a
                                    |   Projection: t.a
                                    |     Projection: __common_expr_1, t.a
                                    |       Filter: __common_expr_1 IS NOT NULL 
AND __datafusion_extracted_2 IS NULL OR __common_expr_1 IS NULL AND 
Boolean(NULL)
                                    |         Projection: 
get_field(__common_expr_1, Utf8("nullable")) AS __datafusion_extracted_2, 
__common_expr_1, t.a
                                    |           Projection: arrow_field(t.a) AS 
__common_expr_1, t.a
                                    |             TableScan: t
   after push_down_leaf_projections | SAME TEXT AS ABOVE
   after optimize_projections       | Projection: t.a
                                    |   Filter: __common_expr_1 IS NOT NULL AND 
__datafusion_extracted_2 IS NULL OR __common_expr_1 IS NULL AND Boolean(NULL)
                                    |     Projection: 
get_field(__common_expr_1, Utf8("nullable")) AS __datafusion_extracted_2, 
__common_expr_1, t.a
                                    |       Projection: arrow_field(t.a) AS 
__common_expr_1, t.a
                                    |         TableScan: t projection=[a]
   ```
   which is what we're going for I think.
   
   a little bit further down the line `push_down_filter` goes ahead and ruins 
things again.
   
   ```
   after push_down_filter | Projection: t.a
                          |   Filter: __datafusion_extracted_2 IS N
                          |     Projection: get_field(__common_expr_1, 
Utf8("nullable")) AS __datafusion_extracted_2, __common_expr_1, t.a
                          |       Projection: arrow_field(t.a) AS 
__common_expr_1, t.a
                          |         Filter: arrow_field(t.a) IS NOT NULL
                          |           TableScan: t projection=[a]
   ```
   
   Does that seem like something we should prevent as well?


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