-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix] fix partial update failure due to column name case #53656
Conversation
Signed-off-by: luohaha <[email protected]>
68373d0
to
213179e
Compare
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 1 / 1 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
|
@Mergifyio backport branch-3.4 |
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: luohaha <[email protected]> (cherry picked from commit 885ed27)
Signed-off-by: luohaha <[email protected]> (cherry picked from commit 885ed27)
Signed-off-by: luohaha <[email protected]> (cherry picked from commit 885ed27)
…53656) (#53688) Co-authored-by: Yixin Luo <[email protected]>
…53656) (#53686) Co-authored-by: Yixin Luo <[email protected]>
…53656) (#53687) Co-authored-by: Yixin Luo <[email protected]>
https://github.com/apps/mergify backport branch-3.1 |
https://github.com/Mergifyio backport branch-3.1 |
✅ Backports have been created
|
Signed-off-by: luohaha <[email protected]> (cherry picked from commit 885ed27)
…53656) (#54462) Co-authored-by: Yixin Luo <[email protected]>
Why I'm doing:
Partial update fail in this case: #53655
This is because in UpdatePlaner.java:
!updateStmt.isAssignmentColumn(column.getName())
is case-sensitively, so if the update column name are not same as which it was defined when create table, it will generate wrong plan. E.g.If you update
salary
instead ofSalary
, it will fail withnumber of exprs is not same with slots backend
.What I'm doing:
Update planner treats column names case-sensitively, which can lead to incorrect execution plans.
This pull request introduces improvements to the handling of column updates in SQL statements and adds corresponding test cases. The most important changes include modifying how assignment columns are stored, adding a new test method for partial updates, and creating new test scripts for upper-case partial updates.
Enhancements to column updates:
fe/fe-core/src/main/java/com/starrocks/sql/ast/UpdateStmt.java
: Changed theassignmentColumns
from aHashSet
to aTreeSet
with case-insensitive ordering to ensure consistent handling of column names.New test cases for partial updates:
fe/fe-core/src/test/java/com/starrocks/sql/plan/UpdatePlanTest.java
: Added a new test methodtestColumnPartialUpdate
to verify the behavior of partial updates in different scenarios.New test scripts for upper-case partial updates:
test/sql/test_partial_update_column_mode/R/test_upper_case_partial_update
: Added a new test script to validate partial updates with upper-case column names. This script includes table creation, data insertion, and update operations.test/sql/test_partial_update_column_mode/T/test_upper_case_partial_update
: Added another test script with the same purpose as the previous one, ensuring thorough testing of partial updates with upper-case column names.Fixes #53655
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: