peter-toth opened a new pull request, #40488:

   ### What changes were proposed in this pull request?
   This PR proposes to replace `EquivalentExpressions` to a simple mutable map 
in `PhysicalAggregation`, the only place where 
`EquivalentExpressions.addExpr()` is used. `EquivalentExpressions` is useful 
for common subexpression elimination but in `PhysicalAggregation` it is used 
only to deduplicate whole expressions which can be easily done with a simple 
   ### Why are the changes needed?
   `EquivalentExpressions.addExpr()` is not guarded by `supportedExpression()` 
which can cause inconsistent results when used together with 
`EquivalentExpressions.getExprState()`, but this PR also proposes replacing 
`.addExpr()` with other alternatives as its boolean result is a bit 
counter-intuitive to other collections' `.add()` methods. It returns `false` if 
the expression was missing and either adds the expression or not depending on 
if the expression is deterministic.
   After this PR we no longer use `EquivalentExpressions.addExpr()` so it can 
be deprecated or even removed...
   ### Does this PR introduce _any_ user-facing change?
   ### How was this patch tested?
   Added new UTs from @rednaxelafx's PR: Please note that new UTs actually 
pass after, but they are added here 
to make sure there will be no regression in the future.

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:

For queries about this service, please contact Infrastructure at:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to