This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 51c8b62d1c4 [opt](Nereids) fix several insert into related issues 
(#40467) (#40755)
51c8b62d1c4 is described below

commit 51c8b62d1c43bda2ae585a2fb4bf544bcf7c61eb
Author: morrySnow <[email protected]>
AuthorDate: Fri Sep 13 10:19:56 2024 +0800

    [opt](Nereids) fix several insert into related issues (#40467) (#40755)
    
    pick from master #40467
    
    - http_stream TVF should always generate one fragment plan
    - http_stream TVF plan should not check root as scan node
    - distinguish group_commit TVF with normal insert statement
    - index and generate slot should based on type cast base slot
    - agg_state could cast from nullable to non-nullable
    - colocated and bucket scan range compute should only on scan node
---
 .../main/java/org/apache/doris/catalog/Type.java   |   4 -
 .../doris/nereids/parser/LogicalPlanBuilder.java   |   2 +-
 .../doris/nereids/rules/analysis/BindSink.java     | 108 ++++++++++++++-------
 .../expressions/functions/table/HttpStream.java    |  11 +++
 .../trees/plans/commands/info/DMLCommandType.java  |   2 +
 .../main/java/org/apache/doris/qe/Coordinator.java |   5 +-
 .../java/org/apache/doris/qe/StmtExecutor.java     |  17 ++--
 .../insert_into_table/insert_use_table_id.out      |  48 ---------
 .../insert_group_commit_into_unique.groovy         |   9 +-
 .../insert_into_table/insert_use_table_id.groovy   | 107 --------------------
 10 files changed, 105 insertions(+), 208 deletions(-)

diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java 
b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
index 1831981f9f2..0d052d900b5 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
@@ -867,10 +867,6 @@ public abstract class Type {
                 return false;
             }
             for (int i = 0; i < sourceAggState.getSubTypes().size(); i++) {
-                // target subtype is not null but source subtype is nullable
-                if (!targetAggState.getSubTypeNullables().get(i) && 
sourceAggState.getSubTypeNullables().get(i)) {
-                    return false;
-                }
                 if (!canCastTo(sourceAggState.getSubTypes().get(i), 
targetAggState.getSubTypes().get(i))) {
                     return false;
                 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
index 10523f0c76e..32cfe310f1e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
@@ -572,7 +572,7 @@ public class LogicalPlanBuilder extends 
DorisParserBaseVisitor<Object> {
                 isAutoDetect,
                 isOverwrite,
                 
ConnectContext.get().getSessionVariable().isEnableUniqueKeyPartialUpdate(),
-                DMLCommandType.INSERT,
+                ctx.tableId == null ? DMLCommandType.INSERT : 
DMLCommandType.GROUP_COMMIT,
                 plan);
         Optional<LogicalPlan> cte = Optional.empty();
         if (ctx.cte() != null) {
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 0bda233e6f3..793ed5cc8f8 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
@@ -67,6 +67,7 @@ import 
org.apache.doris.nereids.trees.plans.visitor.InferPlanOutputAlias;
 import org.apache.doris.nereids.types.DataType;
 import org.apache.doris.nereids.types.StringType;
 import org.apache.doris.nereids.types.coercion.CharacterType;
+import org.apache.doris.nereids.util.ExpressionUtils;
 import org.apache.doris.nereids.util.RelationUtil;
 import org.apache.doris.nereids.util.TypeCoercionUtils;
 
@@ -125,7 +126,8 @@ public class BindSink implements AnalysisRuleFactory {
                 && table.getSequenceMapCol() != null
                 && sink.getColNames().contains(table.getSequenceMapCol());
         Pair<List<Column>, Integer> bindColumnsResult =
-                bindTargetColumns(table, sink.getColNames(), childHasSeqCol, 
needExtraSeqCol);
+                bindTargetColumns(table, sink.getColNames(), childHasSeqCol, 
needExtraSeqCol,
+                        sink.getDMLCommandType() == 
DMLCommandType.GROUP_COMMIT);
         List<Column> bindColumns = bindColumnsResult.first;
         int extraColumnsNum = bindColumnsResult.second;
 
@@ -175,8 +177,12 @@ public class BindSink implements AnalysisRuleFactory {
                             .filter(col -> 
col.getName().equalsIgnoreCase(table.getSequenceMapCol()))
                             .findFirst();
                 } else {
-                    if (!sink.getColNames().isEmpty()) {
-                        if (sink.getColNames().stream()
+                    // ATTN: must use bindColumns here. Because of insert into 
from group_commit tvf submitted by BE
+                    //   do not follow any column list with target table, but 
it contains all inviable data in sink's
+                    //   child. THis is different with other insert action 
that contain non-inviable data by default.
+                    if (!bindColumns.isEmpty()) {
+                        if (bindColumns.stream()
+                                .map(Column::getName)
                                 .anyMatch(c -> 
c.equalsIgnoreCase(Column.SEQUENCE_COL))) {
                             haveInputSeqCol = true; // case2.a
                         } // else case2.b
@@ -204,7 +210,8 @@ public class BindSink implements AnalysisRuleFactory {
 
         Map<String, NamedExpression> columnToOutput = getColumnToOutput(
                 ctx, table, isPartialUpdate, boundSink, child);
-        LogicalProject<?> fullOutputProject = 
getOutputProjectByCoercion(table.getFullSchema(), child, columnToOutput);
+        LogicalProject<?> fullOutputProject = getOutputProjectByCoercion(
+                table.getFullSchema(), child, columnToOutput);
         return boundSink.withChildAndUpdateOutput(fullOutputProject);
     }
 
@@ -266,39 +273,31 @@ public class BindSink implements AnalysisRuleFactory {
         // we need to insert all the columns of the target table
         // although some columns are not mentions.
         // so we add a projects to supply the default value.
-
         Map<Column, NamedExpression> columnToChildOutput = Maps.newHashMap();
         for (int i = 0; i < child.getOutput().size(); ++i) {
             columnToChildOutput.put(boundSink.getCols().get(i), 
child.getOutput().get(i));
         }
-
         Map<String, NamedExpression> columnToOutput = 
Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
+        Map<String, NamedExpression> columnToReplaced = 
Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
+        Map<Expression, Expression> replaceMap = Maps.newHashMap();
         NereidsParser expressionParser = new NereidsParser();
-
+        List<Column> materializedViewColumn = Lists.newArrayList();
         // generate slots not mentioned in sql, mv slots and shaded slots.
         for (Column column : boundSink.getTargetTable().getFullSchema()) {
             if (column.isMaterializedViewColumn()) {
-                List<SlotRef> refs = column.getRefColumns();
-                // now we have to replace the column to slots.
-                Preconditions.checkArgument(refs != null,
-                        "mv column %s 's ref column cannot be null", column);
-                Expression parsedExpression = expressionParser.parseExpression(
-                        column.getDefineExpr().toSqlWithoutTbl());
-                // the boundSlotExpression is an expression whose slots are 
bound but function
-                // may not be bound, we have to bind it again.
-                // for example: to_bitmap.
-                Expression boundExpression = new CustomExpressionAnalyzer(
-                        boundSink, ctx.cascadesContext, 
columnToOutput).analyze(parsedExpression);
-                if (boundExpression instanceof Alias) {
-                    boundExpression = ((Alias) boundExpression).child();
-                }
-                NamedExpression slot = new Alias(boundExpression, 
column.getDefineExpr().toSqlWithoutTbl());
-                columnToOutput.put(column.getName(), slot);
-            } else if (columnToChildOutput.containsKey(column)
+                materializedViewColumn.add(column);
+                continue;
+            }
+            if (columnToChildOutput.containsKey(column)
                     // do not process explicitly use DEFAULT value here:
                     // insert into table t values(DEFAULT)
                     && !(columnToChildOutput.get(column) instanceof 
DefaultValueSlot)) {
-                columnToOutput.put(column.getName(), 
columnToChildOutput.get(column));
+                Alias output = new Alias(TypeCoercionUtils.castIfNotSameType(
+                        columnToChildOutput.get(column), 
DataType.fromCatalogType(column.getType())),
+                        column.getName());
+                columnToOutput.put(column.getName(), output);
+                columnToReplaced.put(column.getName(), output.toSlot());
+                replaceMap.put(output.toSlot(), output.child());
             } else {
                 if (table instanceof OlapTable && ((OlapTable) 
table).hasSequenceCol()
                         && column.getName().equals(Column.SEQUENCE_COL)
@@ -319,6 +318,8 @@ public class BindSink implements AnalysisRuleFactory {
                             seqColumn = new Alias(seqColumn, column.getName());
                         }
                         columnToOutput.put(column.getName(), seqColumn);
+                        columnToReplaced.put(column.getName(), 
seqColumn.toSlot());
+                        replaceMap.put(seqColumn.toSlot(), seqColumn.child(0));
                     }
                 } else if (isPartialUpdate) {
                     // If the current load is a partial update, the values of 
unmentioned
@@ -335,9 +336,12 @@ public class BindSink implements AnalysisRuleFactory {
                         Expression defualtValueExpression = 
ExpressionAnalyzer.analyzeFunction(
                                 boundSink, ctx.cascadesContext, 
unboundFunctionDefaultValue
                         );
-                        columnToOutput.put(column.getName(),
-                                new Alias(defualtValueExpression, 
column.getName())
-                        );
+                        Alias output = new 
Alias(TypeCoercionUtils.castIfNotSameType(
+                                defualtValueExpression, 
DataType.fromCatalogType(column.getType())),
+                                column.getName());
+                        columnToOutput.put(column.getName(), output);
+                        columnToReplaced.put(column.getName(), 
output.toSlot());
+                        replaceMap.put(output.toSlot(), output.child());
                     } else {
                         continue;
                     }
@@ -350,10 +354,11 @@ public class BindSink implements AnalysisRuleFactory {
                     }
                     // Otherwise, the unmentioned columns should be filled 
with default values
                     // or null values
-                    columnToOutput.put(column.getName(), new Alias(
-                            new 
NullLiteral(DataType.fromCatalogType(column.getType())),
-                            column.getName()
-                    ));
+                    Alias output = new Alias(new 
NullLiteral(DataType.fromCatalogType(column.getType())),
+                            column.getName());
+                    columnToOutput.put(column.getName(), output);
+                    columnToReplaced.put(column.getName(), output.toSlot());
+                    replaceMap.put(output.toSlot(), output.child());
                 } else {
                     try {
                         // it comes from the original planner, if default 
value expression is
@@ -372,8 +377,12 @@ public class BindSink implements AnalysisRuleFactory {
                             if (defualtValueExpression instanceof Alias) {
                                 defualtValueExpression = ((Alias) 
defualtValueExpression).child();
                             }
-                            columnToOutput.put(column.getName(),
-                                    new Alias(defualtValueExpression, 
column.getName()));
+                            Alias output = new 
Alias((TypeCoercionUtils.castIfNotSameType(
+                                    defualtValueExpression, 
DataType.fromCatalogType(column.getType()))),
+                                    column.getName());
+                            columnToOutput.put(column.getName(), output);
+                            columnToReplaced.put(column.getName(), 
output.toSlot());
+                            replaceMap.put(output.toSlot(), output.child());
                         }
                     } catch (Exception e) {
                         throw new AnalysisException(e.getMessage(), 
e.getCause());
@@ -381,6 +390,29 @@ public class BindSink implements AnalysisRuleFactory {
                 }
             }
         }
+        for (Column column : materializedViewColumn) {
+            if (column.isMaterializedViewColumn()) {
+                List<SlotRef> refs = column.getRefColumns();
+                // now we have to replace the column to slots.
+                Preconditions.checkArgument(refs != null,
+                        "mv column %s 's ref column cannot be null", column);
+                Expression parsedExpression = expressionParser.parseExpression(
+                        column.getDefineExpr().toSqlWithoutTbl());
+                // the boundSlotExpression is an expression whose slots are 
bound but function
+                // may not be bound, we have to bind it again.
+                // for example: to_bitmap.
+                Expression boundExpression = new CustomExpressionAnalyzer(
+                        boundSink, ctx.cascadesContext, 
columnToReplaced).analyze(parsedExpression);
+                if (boundExpression instanceof Alias) {
+                    boundExpression = ((Alias) boundExpression).child();
+                }
+                boundExpression = ExpressionUtils.replace(boundExpression, 
replaceMap);
+                boundExpression = 
TypeCoercionUtils.castIfNotSameType(boundExpression,
+                        DataType.fromCatalogType(column.getType()));
+                Alias output = new Alias(boundExpression, 
column.getDefineExpr().toSqlWithoutTbl());
+                columnToOutput.put(column.getName(), output);
+            }
+        }
         return columnToOutput;
     }
 
@@ -527,12 +559,14 @@ public class BindSink implements AnalysisRuleFactory {
     }
 
     private Pair<List<Column>, Integer> bindTargetColumns(OlapTable table, 
List<String> colsName,
-            boolean childHasSeqCol, boolean needExtraSeqCol) {
+            boolean childHasSeqCol, boolean needExtraSeqCol, boolean 
isGroupCommit) {
         // if the table set sequence column in stream load phase, the sequence 
map column is null, we query it.
         if (colsName.isEmpty()) {
+            // ATTN: group commit without column list should return all base 
index column
+            //   because it already prepares data for these columns.
             return Pair.of(table.getBaseSchema(true).stream()
-                .filter(c -> validColumn(c, childHasSeqCol))
-                .collect(ImmutableList.toImmutableList()), 0);
+                    .filter(c -> isGroupCommit || validColumn(c, 
childHasSeqCol))
+                    .collect(ImmutableList.toImmutableList()), 0);
         } else {
             int extraColumnsNum = (needExtraSeqCol ? 1 : 0);
             List<String> processedColsName = Lists.newArrayList(colsName);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/HttpStream.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/HttpStream.java
index de052b078db..8e35e25240e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/HttpStream.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/HttpStream.java
@@ -19,12 +19,17 @@ package 
org.apache.doris.nereids.trees.expressions.functions.table;
 
 import org.apache.doris.catalog.FunctionSignature;
 import org.apache.doris.nereids.exceptions.AnalysisException;
+import org.apache.doris.nereids.properties.DistributionSpecHash;
+import org.apache.doris.nereids.properties.DistributionSpecHash.ShuffleType;
+import org.apache.doris.nereids.properties.PhysicalProperties;
 import org.apache.doris.nereids.trees.expressions.Properties;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
 import org.apache.doris.nereids.types.coercion.AnyDataType;
 import org.apache.doris.tablefunction.HttpStreamTableValuedFunction;
 import org.apache.doris.tablefunction.TableValuedFunctionIf;
 
+import com.google.common.collect.ImmutableList;
+
 import java.util.Map;
 
 /** http_stream */
@@ -49,6 +54,12 @@ public class HttpStream extends TableValuedFunction {
         }
     }
 
+    @Override
+    public PhysicalProperties getPhysicalProperties() {
+        return PhysicalProperties.createHash(new 
DistributionSpecHash(ImmutableList.of(),
+                ShuffleType.EXECUTION_BUCKETED));
+    }
+
     @Override
     public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
         return visitor.visitHttpStream(this, context);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DMLCommandType.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DMLCommandType.java
index 18d8179abe4..aa97f26df18 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DMLCommandType.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DMLCommandType.java
@@ -27,6 +27,8 @@ public enum DMLCommandType {
     NONE,
     // for INSERT INTO or INSERT INTO SELECT
     INSERT,
+    // for group_commit tvf
+    GROUP_COMMIT,
     // for UPDATE
     UPDATE,
     // for DELETE
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
index 05cbcb1b061..ef67084741b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -2390,9 +2390,10 @@ public class Coordinator implements CoordInterface {
             FragmentScanRangeAssignment assignment
                     = 
fragmentExecParamsMap.get(scanNode.getFragmentId()).scanRangeAssignment;
             boolean fragmentContainsColocateJoin = 
isColocateFragment(scanNode.getFragment(),
-                    scanNode.getFragment().getPlanRoot());
+                    scanNode.getFragment().getPlanRoot()) && (scanNode 
instanceof OlapScanNode);
             boolean fragmentContainsBucketShuffleJoin = 
bucketShuffleJoinController
-                    .isBucketShuffleJoin(scanNode.getFragmentId().asInt(), 
scanNode.getFragment().getPlanRoot());
+                    .isBucketShuffleJoin(scanNode.getFragmentId().asInt(), 
scanNode.getFragment().getPlanRoot())
+                    && (scanNode instanceof OlapScanNode);
 
             // A fragment may contain both colocate join and bucket shuffle 
join
             // on need both compute scanRange to init basic data for query 
coordinator
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index ec28d53d90b..7efbadbf78a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -3267,8 +3267,16 @@ public class StmtExecutor {
             httpStreamParams.setLabel(insertExecutor.getLabelName());
 
             PlanNode planRoot = planner.getFragments().get(0).getPlanRoot();
-            Preconditions.checkState(planRoot instanceof TVFScanNode || 
planRoot instanceof GroupCommitScanNode,
-                    "Nereids' planNode cannot be converted to " + 
planRoot.getClass().getName());
+            boolean isValidPlan = !planner.getScanNodes().isEmpty();
+            for (ScanNode scanNode : planner.getScanNodes()) {
+                if (!(scanNode instanceof TVFScanNode || planRoot instanceof 
GroupCommitScanNode)) {
+                    isValidPlan = false;
+                    break;
+                }
+            }
+            if (!isValidPlan) {
+                throw new AnalysisException("plan is invalid: " + 
planRoot.getExplainString());
+            }
         } catch (QueryStateException e) {
             LOG.debug("Command(" + originStmt.originStmt + ") process 
failed.", e);
             context.setState(e.getQueryState());
@@ -3339,11 +3347,8 @@ public class StmtExecutor {
                         LOG.warn("Analyze failed. {}", 
context.getQueryIdentifier(), e);
                         throw ((NereidsException) e).getException();
                     }
-                    boolean isInsertIntoCommand = parsedStmt != null && 
parsedStmt instanceof LogicalPlanAdapter
-                            && ((LogicalPlanAdapter) 
parsedStmt).getLogicalPlan() instanceof InsertIntoTableCommand;
                     if (e instanceof NereidsException
-                                && 
!context.getSessionVariable().enableFallbackToOriginalPlanner
-                                && !isInsertIntoCommand) {
+                            && 
!context.getSessionVariable().enableFallbackToOriginalPlanner) {
                         LOG.warn("Analyze failed. {}", 
context.getQueryIdentifier(), e);
                         throw ((NereidsException) e).getException();
                     }
diff --git 
a/regression-test/data/nereids_p0/insert_into_table/insert_use_table_id.out 
b/regression-test/data/nereids_p0/insert_into_table/insert_use_table_id.out
deleted file mode 100644
index d0020443bf6..00000000000
--- a/regression-test/data/nereids_p0/insert_into_table/insert_use_table_id.out
+++ /dev/null
@@ -1,48 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !sql_cross_join --
-1      10      1       1       1.0     2000-01-01      1       10      10      
10.0    2000-01-10      1
-1      10      1       1       1.0     2000-01-01      1       10      10      
10.0    2000-01-10      4
-1      10      1       1       1.0     2000-01-01      1       10      10      
10.0    2000-01-10      5
-1      10      1       1       1.0     2000-01-01      2       20      20      
20.0    2000-01-20      1
-1      10      1       1       1.0     2000-01-01      2       20      20      
20.0    2000-01-20      4
-1      10      1       1       1.0     2000-01-01      2       20      20      
20.0    2000-01-20      5
-1      10      1       1       1.0     2000-01-01      3       30      30      
30.0    2000-01-30      1
-1      10      1       1       1.0     2000-01-01      3       30      30      
30.0    2000-01-30      4
-1      10      1       1       1.0     2000-01-01      3       30      30      
30.0    2000-01-30      5
-1      10      1       1       1.0     2000-01-01      4       4       4       
4.0     2000-01-04      1
-1      10      1       1       1.0     2000-01-01      4       4       4       
4.0     2000-01-04      4
-1      10      1       1       1.0     2000-01-01      4       4       4       
4.0     2000-01-04      5
-1      10      1       1       1.0     2000-01-01      5       5       5       
5.0     2000-01-05      1
-1      10      1       1       1.0     2000-01-01      5       5       5       
5.0     2000-01-05      4
-1      10      1       1       1.0     2000-01-01      5       5       5       
5.0     2000-01-05      5
-2      20      2       2       2.0     2000-01-02      1       10      10      
10.0    2000-01-10      1
-2      20      2       2       2.0     2000-01-02      1       10      10      
10.0    2000-01-10      4
-2      20      2       2       2.0     2000-01-02      1       10      10      
10.0    2000-01-10      5
-2      20      2       2       2.0     2000-01-02      2       20      20      
20.0    2000-01-20      1
-2      20      2       2       2.0     2000-01-02      2       20      20      
20.0    2000-01-20      4
-2      20      2       2       2.0     2000-01-02      2       20      20      
20.0    2000-01-20      5
-2      20      2       2       2.0     2000-01-02      3       30      30      
30.0    2000-01-30      1
-2      20      2       2       2.0     2000-01-02      3       30      30      
30.0    2000-01-30      4
-2      20      2       2       2.0     2000-01-02      3       30      30      
30.0    2000-01-30      5
-2      20      2       2       2.0     2000-01-02      4       4       4       
4.0     2000-01-04      1
-2      20      2       2       2.0     2000-01-02      4       4       4       
4.0     2000-01-04      4
-2      20      2       2       2.0     2000-01-02      4       4       4       
4.0     2000-01-04      5
-2      20      2       2       2.0     2000-01-02      5       5       5       
5.0     2000-01-05      1
-2      20      2       2       2.0     2000-01-02      5       5       5       
5.0     2000-01-05      4
-2      20      2       2       2.0     2000-01-02      5       5       5       
5.0     2000-01-05      5
-3      30      3       3       3.0     2000-01-03      1       10      10      
10.0    2000-01-10      1
-3      30      3       3       3.0     2000-01-03      1       10      10      
10.0    2000-01-10      4
-3      30      3       3       3.0     2000-01-03      1       10      10      
10.0    2000-01-10      5
-3      30      3       3       3.0     2000-01-03      2       20      20      
20.0    2000-01-20      1
-3      30      3       3       3.0     2000-01-03      2       20      20      
20.0    2000-01-20      4
-3      30      3       3       3.0     2000-01-03      2       20      20      
20.0    2000-01-20      5
-3      30      3       3       3.0     2000-01-03      3       30      30      
30.0    2000-01-30      1
-3      30      3       3       3.0     2000-01-03      3       30      30      
30.0    2000-01-30      4
-3      30      3       3       3.0     2000-01-03      3       30      30      
30.0    2000-01-30      5
-3      30      3       3       3.0     2000-01-03      4       4       4       
4.0     2000-01-04      1
-3      30      3       3       3.0     2000-01-03      4       4       4       
4.0     2000-01-04      4
-3      30      3       3       3.0     2000-01-03      4       4       4       
4.0     2000-01-04      5
-3      30      3       3       3.0     2000-01-03      5       5       5       
5.0     2000-01-05      1
-3      30      3       3       3.0     2000-01-03      5       5       5       
5.0     2000-01-05      4
-3      30      3       3       3.0     2000-01-03      5       5       5       
5.0     2000-01-05      5
-
diff --git 
a/regression-test/suites/insert_p0/insert_group_commit_into_unique.groovy 
b/regression-test/suites/insert_p0/insert_group_commit_into_unique.groovy
index 83247d25129..05cd6da6483 100644
--- a/regression-test/suites/insert_p0/insert_group_commit_into_unique.groovy
+++ b/regression-test/suites/insert_p0/insert_group_commit_into_unique.groovy
@@ -86,7 +86,8 @@ suite("insert_group_commit_into_unique") {
             UNIQUE KEY(`id`, `name`)
             DISTRIBUTED BY HASH(`id`) BUCKETS 1
             PROPERTIES (
-                "replication_num" = "1"
+                "replication_num" = "1",
+                "group_commit_interval_ms" = "100"
             );
             """
 
@@ -172,7 +173,8 @@ suite("insert_group_commit_into_unique") {
             DISTRIBUTED BY HASH(`id`) BUCKETS 1
             PROPERTIES (
                 "replication_num" = "1",
-                "function_column.sequence_col" = "score"
+                "function_column.sequence_col" = "score",
+                "group_commit_interval_ms" = "100"
             );
             """
 
@@ -259,7 +261,8 @@ suite("insert_group_commit_into_unique") {
             DISTRIBUTED BY HASH(`id`) BUCKETS 1
             PROPERTIES (
                 "replication_num" = "1",
-                "function_column.sequence_type" = "int"
+                "function_column.sequence_type" = "int",
+                "group_commit_interval_ms" = "100"
             );
             """
 
diff --git 
a/regression-test/suites/nereids_p0/insert_into_table/insert_use_table_id.groovy
 
b/regression-test/suites/nereids_p0/insert_into_table/insert_use_table_id.groovy
deleted file mode 100644
index 930fe35b60e..00000000000
--- 
a/regression-test/suites/nereids_p0/insert_into_table/insert_use_table_id.groovy
+++ /dev/null
@@ -1,107 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-
-
-
-suite('nereids_insert_use_table_id') {
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql 'set enable_nereids_dml=true'
-    sql 'set enable_strict_consistency_dml=true'
-
-    // sql 'CREATE DATABASE IF NOT EXISTS dnereids_insert_use_table_id_test'
-    // sql 'use nereids_insert_use_table_id_test'
-
-    def t1 = 'table_id_value_t1'
-    def t2 = 'table_id_value_t2'
-    def t3 = 'table_id_value_t3'
-
-    sql "drop table if exists ${t1}"
-    sql "drop table if exists ${t2}"
-    sql "drop table if exists ${t3}"
-
-    sql """
-        create table ${t1} (
-            id int,
-            id1 int,
-            c1 bigint,
-            c2 string,
-            c3 double,
-            c4 date
-        ) unique key (id, id1)
-        distributed by hash(id, id1) buckets 13
-        properties(
-            'replication_num'='1',
-            "function_column.sequence_col" = "c4"
-        );
-    """
-
-    sql """
-        create table ${t2} (
-            id int,
-            c1 bigint,
-            c2 string,
-            c3 double,
-            c4 date
-        ) unique key (id)
-        distributed by hash(id) buckets 13
-        properties(
-            'replication_num'='1'
-        );
-    """
-
-    sql """
-        create table ${t3} (
-            id int
-        ) distributed by hash(id) buckets 13
-        properties(
-            'replication_num'='1'
-        );
-    """
-
-
-    sql """
-        INSERT INTO DORIS_INTERNAL_TABLE_ID(${getTableId(t1)}) VALUES
-            (1, (1 + 9) * (10 - 9), 1, '1', 1.0, '2000-01-01'),
-            (2, 20, 2, '2', 2.0, days_add('2000-01-01', 1)),
-            (3, 30, 3, '3', 3.0, makedate(2000, 3));
-    """
-
-    sql """
-        INSERT INTO DORIS_INTERNAL_TABLE_ID(${getTableId(t2)}) VALUES
-            (1, 10, '10', 10.0, '2000-01-10'),
-            (2, 20, '20', 20.0, '2000-01-20'),
-            (3, 30, '30', 30.0, '2000-01-30'),
-            (4, 4, '4', 4.0, '2000-01-04'),
-            (5, 5, '5', 5.0, '2000-01-05');
-    """
-
-    sql """
-        INSERT INTO DORIS_INTERNAL_TABLE_ID(${getTableId(t3)}) VALUES
-            (1),
-            (4),
-            (5);
-    """
-
-    sql "sync"
-    qt_sql_cross_join "select * from ${t1}, ${t2}, ${t3} order by ${t1}.id, 
${t1}.id1, ${t2}.id, ${t3}.id"
-
-
-}
-
-


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to