sekaiser commented on issue #27404:
URL: https://github.com/apache/datafusion/issues/27404#issuecomment-6866913080
I tested the exact reproduction on `main` at
`6c429176e589a00f468b009e11904f11df334024`. The focused SQL logic test passes
with the expected result (`false`, `true`).
Executed with:
```bash
RUST_LOG=datafusion_optimizer=debug,datafusion::physical_planner=debug \
cargo test --locked --profile=ci --test sqllogictests -- issue_27404.slt
```
The optimizer logs confirm that CSE extracts the shared expression:
```text
common_sub_expression_eliminate:
Projection: min(t.b IS TRUE), max(t.b IS TRUE)
Aggregate: groupBy=[[]], aggr=[[min(__common_expr_1 AS t.b IS TRUE),
max(__common_expr_1 AS t.b IS TRUE)]]
Projection: t.b IS TRUE AS __common_expr_1, t.b
SubqueryAlias: t
Projection: column1 AS b
Values: (Boolean(true)), (Boolean(NULL))
```
The final physical plan retains the shared projection:
```text
Optimized physical plan:
AggregateExec: mode=Single, gby=[], aggr=[min(t.b IS TRUE), max(t.b IS
TRUE)]
ProjectionExec: expr=[column1@0 IS NOT DISTINCT FROM true as
__common_expr_1]
DataSourceExec: partitions=1, partition_sizes=[1]
```
CSE and aggregate schema validation were enabled, with no configuration
overrides.
This appears related to #24096, addressed by #24244, which corrected
physical distinctness expression nullability.
I can't establish whether that earlier fix explains the reported failure,
because the report doesn't specify a DataFusion revision. However, the exact
query is not reproducible on current `main`, including the reported CSE path.
--
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]