diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java index 1b0d8e59dd..b9e74557cd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java @@ -467,7 +467,7 @@ public class NativeInsertStmt extends InsertStmt { haveInputSeqCol = true; // case1.b } seqColInTable = olapTable.getFullSchema().stream() - .filter(col -> col.getName().equals(olapTable.getSequenceMapCol())).findFirst(); + .filter(col -> col.getName().equalsIgnoreCase(olapTable.getSequenceMapCol())).findFirst(); } else { if (targetColumnNames != null) { if (targetColumnNames.stream() @@ -480,7 +480,8 @@ public class NativeInsertStmt extends InsertStmt { if (!haveInputSeqCol && !isPartialUpdate && !isFromDeleteOrUpdateStmt && !analyzer.getContext().getSessionVariable().isEnableUniqueKeyPartialUpdate()) { if (!seqColInTable.isPresent() || seqColInTable.get().getDefaultValue() == null - || !seqColInTable.get().getDefaultValue().equals(DefaultValue.CURRENT_TIMESTAMP)) { + || !seqColInTable.get().getDefaultValue() + .equalsIgnoreCase(DefaultValue.CURRENT_TIMESTAMP)) { throw new AnalysisException("Table " + olapTable.getName() + " has sequence column, need to specify the sequence column"); } @@ -488,14 +489,14 @@ public class NativeInsertStmt extends InsertStmt { } if (isPartialUpdate && olapTable.hasSequenceCol() && olapTable.getSequenceMapCol() != null - && partialUpdateCols.contains(olapTable.getSequenceMapCol())) { + && partialUpdateCols.stream().anyMatch(c -> c.equalsIgnoreCase(olapTable.getSequenceMapCol()))) { partialUpdateCols.add(Column.SEQUENCE_COL); } // need a descriptor DescriptorTable descTable = analyzer.getDescTbl(); olapTuple = descTable.createTupleDescriptor(); for (Column col : olapTable.getFullSchema()) { - if (isPartialUpdate && !partialUpdateCols.contains(col.getName())) { + if (isPartialUpdate && partialUpdateCols.stream().noneMatch(c -> c.equalsIgnoreCase(col.getName()))) { continue; } SlotDescriptor slotDesc = descTable.addSlotDescriptor(olapTuple); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java index c0e8162f08..5c8a74f00e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java @@ -128,17 +128,20 @@ public class BindSink implements AnalysisRuleFactory { Optional seqColInTable = Optional.empty(); if (table.getSequenceMapCol() != null) { if (!sink.getColNames().isEmpty()) { - if (sink.getColNames().contains(table.getSequenceMapCol())) { + if (sink.getColNames().stream() + .anyMatch(c -> c.equalsIgnoreCase(table.getSequenceMapCol()))) { haveInputSeqCol = true; // case1.a } } else { haveInputSeqCol = true; // case1.b } seqColInTable = table.getFullSchema().stream() - .filter(col -> col.getName().equals(table.getSequenceMapCol())).findFirst(); + .filter(col -> col.getName().equalsIgnoreCase(table.getSequenceMapCol())) + .findFirst(); } else { if (!sink.getColNames().isEmpty()) { - if (sink.getColNames().contains(Column.SEQUENCE_COL)) { + if (sink.getColNames().stream() + .anyMatch(c -> c.equalsIgnoreCase(Column.SEQUENCE_COL))) { haveInputSeqCol = true; // case2.a } // else case2.b } @@ -153,7 +156,7 @@ public class BindSink implements AnalysisRuleFactory { && boundSink.getDmlCommandType() != DMLCommandType.DELETE)) { if (!seqColInTable.isPresent() || seqColInTable.get().getDefaultValue() == null || !seqColInTable.get().getDefaultValue() - .equals(DefaultValue.CURRENT_TIMESTAMP)) { + .equalsIgnoreCase(DefaultValue.CURRENT_TIMESTAMP)) { throw new org.apache.doris.common.AnalysisException("Table " + table.getName() + " has sequence column, need to specify the sequence column"); }