[Fix](partial update) Fix partial update load false when schema includes auto increment column (#31725)
Problem: When partially updating columns without specifying the auto-increment column, and the imported data contains new keys, an error stating the auto-increment column could not be found occurs. Reason: The logic for partial column updates does not account for new keys in auto-increment columns. Since auto-increment columns can be generated by the system, it's possible to omit this column data during import. However, partial column updates treat this as a regular column, expecting it to be nullable or have a default value for automatic filling, overlooking the fact that auto-increment columns can also be auto-filled. This oversight leads to the error. Solution: Incorporate a check for auto-increment columns into the partial column update logic, and include the logic for generating auto-increment column values in the process of completing partial updates.
This commit is contained in:
@ -301,6 +301,11 @@ public class OlapTableSink extends DataSink {
|
||||
for (String s : partialUpdateInputColumns) {
|
||||
schemaParam.addToPartialUpdateInputColumns(s);
|
||||
}
|
||||
for (Column col : table.getFullSchema()) {
|
||||
if (col.isAutoInc()) {
|
||||
schemaParam.setAutoIncrementColumn(col.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return schemaParam;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user