Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void initColumns(FileLoadScanNode.ParamCreateContext context, Analyzer a
.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()) {
Expand Down Expand Up @@ -226,6 +226,17 @@ private void initColumns(FileLoadScanNode.ParamCreateContext context, Analyzer a
}
}

/**
* 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();
Expand Down