[fix](insert into) 'output_tuple_slot_num should be equal to output_expr_num' when insert into unique table with sequence column map (#30635)
This commit is contained in:
@ -929,10 +929,11 @@ public class NativeInsertStmt extends InsertStmt {
|
||||
&& col.getName().equals(Column.SEQUENCE_COL)
|
||||
&& ((OlapTable) targetTable).getSequenceMapCol() != null) {
|
||||
if (resultExprByName.stream().map(Pair::key)
|
||||
.anyMatch(key -> key.equals(((OlapTable) targetTable).getSequenceMapCol()))) {
|
||||
.anyMatch(key -> key.equalsIgnoreCase(((OlapTable) targetTable).getSequenceMapCol()))) {
|
||||
resultExprByName.add(Pair.of(Column.SEQUENCE_COL,
|
||||
resultExprByName.stream()
|
||||
.filter(p -> p.key().equals(((OlapTable) targetTable).getSequenceMapCol()))
|
||||
.filter(p -> p.key()
|
||||
.equalsIgnoreCase(((OlapTable) targetTable).getSequenceMapCol()))
|
||||
.map(Pair::value).findFirst().orElse(null)));
|
||||
}
|
||||
continue;
|
||||
|
||||
@ -2434,7 +2434,7 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
if (!col.getType().isFixedPointType() && !col.getType().isDateType()) {
|
||||
throw new DdlException("Sequence type only support integer types and date types");
|
||||
}
|
||||
olapTable.setSequenceMapCol(sequenceMapCol);
|
||||
olapTable.setSequenceMapCol(col.getName());
|
||||
olapTable.setSequenceInfo(col.getType());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -36,7 +36,7 @@ suite("test_sequence_col_default_value") {
|
||||
PROPERTIES (
|
||||
"replication_allocation" = "tag.location.default: 1",
|
||||
"enable_unique_key_merge_on_write" = "true",
|
||||
"function_column.sequence_col" = 'write_time'
|
||||
"function_column.sequence_col" = 'WRITE_TIME'
|
||||
);
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user