[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:
abmdocrt
2024-03-05 11:39:04 +08:00
committed by yiguolei
parent 2a1c00f180
commit 7c30cb20fd
23 changed files with 200 additions and 50 deletions

View File

@ -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;
}