[Fix](variant) fallback to none partial update for mow table (#28116)

This commit is contained in:
lihangyu
2023-12-07 19:30:24 +08:00
committed by GitHub
parent 942450a2e5
commit cc9b4bcddb
3 changed files with 23 additions and 5 deletions

View File

@ -189,8 +189,12 @@ public class UpdateStmt extends DdlStmt {
// step3: generate select list and insert column name list in insert stmt
boolean isMow = ((OlapTable) targetTable).getEnableUniqueKeyMergeOnWrite();
boolean hasVariant = false;
int setExprCnt = 0;
for (Column column : targetTable.getColumns()) {
if (column.getType().isVariantType()) {
hasVariant = true;
}
for (BinaryPredicate setExpr : setExprs) {
Expr lhs = setExpr.getChild(0);
if (((SlotRef) lhs).getColumn().equals(column)) {
@ -198,10 +202,13 @@ public class UpdateStmt extends DdlStmt {
}
}
}
// table with sequence col cannot use partial update cause in MOW, we encode pk
// 1.table with sequence col cannot use partial update cause in MOW, we encode pk
// with seq column but we don't know which column is sequence in update
// 2. variant column update schema during load, so implement partial update is complicated,
// just ignore it at present
if (isMow && ((OlapTable) targetTable).getSequenceCol() == null
&& setExprCnt <= targetTable.getColumns().size() * 3 / 10) {
&& setExprCnt <= targetTable.getColumns().size() * 3 / 10
&& !hasVariant) {
isPartialUpdate = true;
}
for (Column column : targetTable.getColumns()) {