[IOTDB-17635] Fix window function identity with OVER clause#17645
[IOTDB-17635] Fix window function identity with OVER clause#17645DaZuiZui wants to merge 2 commits into
Conversation
|
thank |
|
@DaZuiZui And I have noticed there are some ITs are not passed in CI, it seems to be caused by |
|
@Wei-hao-Li thank ~ |
c6c7950 to
fbf6fa4
Compare
|
sorry |
|
Hi @Wei-hao-Li, I checked the failed Windows Simple IT log. The Maven Failsafe error seems to be only the final summary, while the actual failure is: From the log, this failure happened during Since this test is unrelated to the window function changes in this PR, it looks more like a Windows CI cluster startup issue. Could you please help rerun this Windows Simple IT check? Thanks! |
Done |
|
Thank @Wei-hao-Li @JackieTien97 |


Description
Fixes #17635.
Bug fix
This PR fixes an incorrect result issue when the same window function appears multiple times with different
OVERclauses.For example, two
rank()calls with differentORDER BYexpressions could be treated as the same function expression during planning, causing one result symbol to be reused incorrectly.Root cause
FunctionCalldid not include itswindowspecification in AST children, equality, hashing, or shallow AST comparison.As a result, scope-aware expression deduplication and symbol mapping could consider window function calls equivalent when they had the same function name and arguments but different
OVERclauses.Fix
This PR updates
FunctionCallidentity to include window-related information:windowinFunctionCall#getChildren();windowandnullTreatmentinequals()andhashCode();shallowEquals()to distinguish function calls with and without window specs and different null treatment;rank()functions with different window ordering.Tests
The following checks were run:
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
org.apache.iotdb.commons.queryengine.plan.relational.sql.ast.FunctionCallorg.apache.iotdb.relational.it.db.it.IoTDBWindowFunction3IT