englefly opened a new pull request, #66906:
URL: https://github.com/apache/doris/pull/66906
### What problem does this PR solve?
Problem Summary:
A project expression that computes a function over a uniform constant slot
(e.g.
`date_sub(dt, INTERVAL 1 DAY)` where `dt` is a uniform constant slot) did
not propagate
the resulting constant: `LogicalProject.computeUniform` only handled
constant projects and
bare slot aliases, so the projected slot had no uniform value and downstream
constant
propagation could not fold predicates over it. For a join predicate like
`t1.dt = p.prev_dt` where `p.prev_dt` is such a projection, the predicate
stayed
unfolded, could not be pushed into the scan, and partition pruning failed.
Fix:
`LogicalProject`/`PhysicalProject`/`LogicalLoadProject.computeUniform` now
fold a project
expression whose input slots are all uniform constants: the constant values
are
substituted into the expression (new helper
`ExpressionUtils.foldToConstantByUniformValues`) and the projected slot is
registered as
a uniform constant, so downstream constant propagation can fold predicates
over it and
push them into the scan for partition pruning.
### Release note
None
### Check List (For Author)
- Test: FE unit test ConstantProjectionFoldingTest (the uniform constant
source is a
filter predicate, independent of constant CTEs; asserts the outer scan
prunes to the
expected single partition).
- Behavior changed: No
- Does this need documentation: No
--
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]