This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit b7e2ccd4eb674bdd2d8d69ebe2b5c3f6950e3a3c Author: Calvin Kirs <[email protected]> AuthorDate: Fri Aug 18 21:49:09 2023 +0800 [Fix](RoutineLoad)Fix when Unique (MoW) RoutineLoad imports unspecified Sequence column (#23167) [Fix](RoutineLoad)Fix when Unique (MoW) routineload imports unspecified Sequence column --- .../org/apache/doris/planner/external/LoadScanProvider.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/external/LoadScanProvider.java b/fe/fe-core/src/main/java/org/apache/doris/planner/external/LoadScanProvider.java index 9089f0c2c7..25be5de433 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/external/LoadScanProvider.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/external/LoadScanProvider.java @@ -190,7 +190,7 @@ public class LoadScanProvider { .filter(c -> c.getColumnName().equalsIgnoreCase(finalSequenceCol)).findAny(); // if `columnDescs.descs` is empty, that means it's not a partial update load, and user not specify // column name. - if (foundCol.isPresent() || columnDescs.descs.isEmpty()) { + if (foundCol.isPresent() || shouldAddSequenceColumn(columnDescs)) { columnDescs.descs.add(new ImportColumnDesc(Column.SEQUENCE_COL, new SlotRef(null, sequenceCol))); } else if (!fileGroupInfo.isPartialUpdate()) { @@ -226,6 +226,17 @@ public class LoadScanProvider { } } + /** + * if not set sequence column and column size is null or only have deleted sign ,return true + */ + private boolean shouldAddSequenceColumn(LoadTaskInfo.ImportColumnDescs columnDescs) { + if (columnDescs.descs.isEmpty()) { + return true; + } + return columnDescs.descs.size() == 1 && columnDescs.descs.get(0).getColumnName() + .equalsIgnoreCase(Column.DELETE_SIGN); + } + private TFileFormatType formatType(String fileFormat, String path) throws UserException { if (fileFormat != null) { String lowerFileFormat = fileFormat.toLowerCase(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
