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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c56a372  [improvement][fix](grouping-set)(tablet-repair) optimize 
compaction too slow replica process, (#8123)
c56a372 is described below

commit c56a372e066c0c088c2aa86e984ba13a8f821d1a
Author: Zhengguo Yang <yangz...@gmail.com>
AuthorDate: Thu Mar 3 22:30:35 2022 +0800

    [improvement][fix](grouping-set)(tablet-repair) optimize compaction too 
slow replica process, (#8123)
    
    1. optimize compaction too slow replica process, will set to ok if the 
replica compaction is done.
    And will not set bad if more than half replica is too slow,
    2. fix field in grouping_id() is not the same name will cause error lile  
`select list expression not produced by
    aggregation output (missing from GROUP BY clause?): id`
---
 .../src/main/java/org/apache/doris/PaloFe.java     |  4 +-
 .../org/apache/doris/analysis/GroupingInfo.java    | 18 ++++----
 .../org/apache/doris/analysis/VirtualSlotRef.java  |  7 ++++
 .../java/org/apache/doris/catalog/Replica.java     | 22 ++++++----
 .../main/java/org/apache/doris/catalog/Tablet.java |  5 ++-
 .../org/apache/doris/clone/TabletSchedCtx.java     | 25 ++++++++++-
 .../org/apache/doris/clone/TabletScheduler.java    | 48 ++++++++++++++--------
 .../doris/clone/TabletReplicaTooSlowTest.java      | 21 ++++++----
 .../org/apache/doris/planner/QueryPlanTest.java    | 16 ++++++++
 9 files changed, 119 insertions(+), 47 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java 
b/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
index c1be920..c954055 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
@@ -38,9 +38,9 @@ import org.apache.doris.service.FrontendOptions;
 import com.google.common.base.Charsets;
 import com.google.common.base.Strings;
 
-import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.logging.log4j.LogManager;
@@ -208,7 +208,7 @@ public class PaloFe {
      *
      */
     private static CommandLineOptions parseArgs(String[] args) {
-        CommandLineParser commandLineParser = new BasicParser();
+        CommandLineParser commandLineParser = new DefaultParser();
         Options options = new Options();
         options.addOption("v", "version", false, "Print the version of Palo 
Frontend");
         options.addOption("h", "helper", true, "Specify the helper node when 
joining a bdb je replication group");
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/GroupingInfo.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/GroupingInfo.java
index 41f544d..7968fb3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/GroupingInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/GroupingInfo.java
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
 
 public class GroupingInfo {
     public static final String COL_GROUPING_ID = "GROUPING_ID";
-    private GroupByClause groupByClause;
+    public static final String GROUPING_PREFIX = "GROUPING_PREFIX_";
     private VirtualSlotRef groupingIDSlot;
     private TupleDescriptor virtualTuple;
     private Set<VirtualSlotRef> groupingSlots;
@@ -42,7 +42,6 @@ public class GroupingInfo {
     private BitSet bitSetAll;
 
     public GroupingInfo(Analyzer analyzer, GroupByClause groupByClause) throws 
AnalysisException {
-        this.groupByClause = groupByClause;
         this.groupingType = groupByClause.getGroupingType();
         groupingSlots = new LinkedHashSet<>();
         virtualTuple = 
analyzer.getDescTbl().createTupleDescriptor("VIRTUAL_TUPLE");
@@ -59,10 +58,6 @@ public class GroupingInfo {
         return virtualTuple;
     }
 
-    public VirtualSlotRef getGroupingIDSlot() {
-        return groupingIDSlot;
-    }
-
     public List<BitSet> getGroupingIdList() {
         return groupingIdList;
     }
@@ -71,7 +66,7 @@ public class GroupingInfo {
     public VirtualSlotRef addGroupingSlots(List<Expr> realSlots, Analyzer 
analyzer) throws AnalysisException {
         String colName = realSlots.stream().map(expr -> 
expr.toSql()).collect(Collectors.joining(
                 "_"));
-        colName = "GROUPING_PREFIX_" + colName;
+        colName = GROUPING_PREFIX + colName;
         VirtualSlotRef virtualSlot = new VirtualSlotRef(colName, Type.BIGINT, 
virtualTuple, realSlots);
         virtualSlot.analyze(analyzer);
         if (groupingSlots.contains(virtualSlot)) {
@@ -133,7 +128,7 @@ public class GroupingInfo {
     }
 
     // generate grouping function's value
-    public List<List<Long>> genGroupingList(ArrayList<Expr> groupingExprs) {
+    public List<List<Long>> genGroupingList(ArrayList<Expr> groupingExprs) 
throws AnalysisException {
         List<List<Long>> groupingList = new ArrayList<>();
         for (SlotRef slot : groupingSlots) {
             List<Long> glist = new ArrayList<>();
@@ -155,6 +150,10 @@ public class GroupingInfo {
                     int slotSize = ((VirtualSlotRef) 
slot).getRealSlots().size();
                     for (int i = 0; i < slotSize; ++i) {
                         int j = groupingExprs.indexOf(((VirtualSlotRef) 
slot).getRealSlots().get(i));
+                        if (j < 0  || j >= bitSet.size()) {
+                            throw new AnalysisException("Column " + 
((VirtualSlotRef) slot).getRealColumnName()
+                                    + " in GROUP_ID() does not exist in GROUP 
BY clause.");
+                        }
                         l += bitSet.get(j) ? 0L : (1L << (slotSize - i - 1));
                     }
                 }
@@ -191,9 +190,6 @@ public class GroupingInfo {
                     if (colIndex != -1 && 
!(ref.getViewStmt().getResultExprs().get(colIndex) instanceof SlotRef)) {
                         throw new AnalysisException("grouping functions only 
support column in current version.");
                     }
-                } else if (!groupByClause.getGroupingExprs().contains(child)) {
-                    throw new AnalysisException("select list expression not 
produced by aggregation output" +
-                            " (missing from GROUP BY clause?): " + ((SlotRef) 
child).getColumnName());
                 }
             }
             // if is substituted skip
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/VirtualSlotRef.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/VirtualSlotRef.java
index 21486f2..9696bab 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/VirtualSlotRef.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/VirtualSlotRef.java
@@ -61,6 +61,13 @@ public class VirtualSlotRef extends SlotRef {
         return virtualSlotRef;
     }
 
+    public String getRealColumnName() {
+        if (getColumnName().startsWith(GroupingInfo.GROUPING_PREFIX)) {
+            return 
getColumnName().substring(GroupingInfo.GROUPING_PREFIX.length());
+        }
+        return getColumnName();
+    }
+
     @Override
     public void write(DataOutput out) throws IOException {
         super.write(out);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
index c8ca4e1..2eaf5a2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
@@ -45,10 +45,12 @@ public class Replica implements Writable {
         SCHEMA_CHANGE,
         CLONE,
         ALTER, // replica is under rollup or schema change
-        DECOMMISSION; // replica is ready to be deleted
+        DECOMMISSION, // replica is ready to be deleted
+        COMPACTION_TOO_SLOW; // replica version count is too large
+
 
         public boolean canLoad() {
-            return this == NORMAL || this == SCHEMA_CHANGE || this == ALTER;
+            return this == NORMAL || this == SCHEMA_CHANGE || this == ALTER || 
this == COMPACTION_TOO_SLOW;
         }
 
         public boolean canQuery() {
@@ -401,19 +403,23 @@ public class Replica implements Writable {
     public void setState(ReplicaState replicaState) {
         this.state = replicaState;
     }
-    
+
     public ReplicaState getState() {
         return this.state;
     }
 
+    public boolean tooSlow() {
+        return state == ReplicaState.COMPACTION_TOO_SLOW;
+    }
+
     public long getVersionCount() {
-               return versionCount;
-       }
+        return versionCount;
+    }
 
     public void setVersionCount(long versionCount) {
-               this.versionCount = versionCount;
-       }
-    
+        this.versionCount = versionCount;
+    }
+
     @Override
     public String toString() {
         StringBuffer strBuffer = new StringBuffer("[replicaId=");
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
index 2d0cd91..938c7bd 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
@@ -68,7 +68,7 @@ public class Tablet extends MetaObject implements Writable {
         COLOCATE_MISMATCH, // replicas do not all locate in right colocate 
backends set.
         COLOCATE_REDUNDANT, // replicas match the colocate backends set, but 
redundant.
         NEED_FURTHER_REPAIR, // one of replicas need a definite repair.
-        UNRECOVERABLE,   // non of replicas are healthy
+        UNRECOVERABLE,   // none of replicas are healthy
         REPLICA_COMPACTION_TOO_SLOW // one replica's version count is much 
more than other replicas;
     }
 
@@ -406,7 +406,8 @@ public class Tablet extends MetaObject implements Writable {
         ArrayList<Long> versions = new ArrayList<>();
         for (Replica replica : replicas) {
             Backend backend = 
systemInfoService.getBackend(replica.getBackendId());
-            if (backend == null || !backend.isAlive() || !replica.isAlive() || 
!hosts.add(backend.getHost())) {
+            if (backend == null || !backend.isAlive() || !replica.isAlive() || 
!hosts.add(backend.getHost())
+                    || replica.tooSlow()) {
                 // this replica is not alive,
                 // or if this replica is on same host with another replica, we 
also treat it as 'dead',
                 // so that Tablet Scheduler will create a new replica on 
different host.
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java 
b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java
index 3e6c8f6..6610b48 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java
@@ -479,6 +479,29 @@ public class TabletSchedCtx implements 
Comparable<TabletSchedCtx> {
         return tabletOrderIdx;
     }
 
+    public boolean compactionRecovered() {
+        Replica chosenReplica = null;
+        long maxVersionCount = -1;
+        long minVersionCount = Integer.MAX_VALUE;
+        for (Replica replica : tablet.getReplicas()) {
+            if (replica.getVersionCount() > maxVersionCount) {
+                maxVersionCount = replica.getVersionCount();
+                chosenReplica = replica;
+            }
+            if (replica.getVersionCount() < minVersionCount) {
+                minVersionCount = replica.getVersionCount();
+            }
+        }
+        boolean recovered = false;
+        for (Replica replica : tablet.getReplicas()) {
+            if (replica.isAlive() && replica.tooSlow() && 
!chosenReplica.equals(replica)) {
+                chosenReplica.setState(ReplicaState.NORMAL);
+                recovered = true;
+            }
+        }
+        return recovered;
+    }
+
     // database lock should be held.
     // If exceptBeId != -1, should not choose src replica with same BE id as 
exceptBeId
     public void chooseSrcReplica(Map<Long, PathSlot> backendsWorkingSlots, 
long exceptBeId) throws SchedException {
@@ -493,7 +516,7 @@ public class TabletSchedCtx implements 
Comparable<TabletSchedCtx> {
                 continue;
             }
 
-            if (replica.isBad()) {
+            if (replica.isBad() || replica.tooSlow()) {
                 continue;
             }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java 
b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
index 1c211fa..1f80cad 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
@@ -39,7 +39,6 @@ import org.apache.doris.clone.TabletSchedCtx.Type;
 import org.apache.doris.common.AnalysisException;
 import org.apache.doris.common.Config;
 import org.apache.doris.common.FeConstants;
-import org.apache.doris.common.MetaNotFoundException;
 import org.apache.doris.common.Pair;
 import org.apache.doris.common.util.MasterDaemon;
 import org.apache.doris.persist.ReplicaPersistInfo;
@@ -53,6 +52,8 @@ import org.apache.doris.task.AgentTaskQueue;
 import org.apache.doris.task.CloneTask;
 import org.apache.doris.task.DropReplicaTask;
 import org.apache.doris.thrift.TFinishTaskRequest;
+import org.apache.doris.transaction.DatabaseTransactionMgr;
+import org.apache.doris.transaction.TransactionState;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.EvictingQueue;
@@ -63,8 +64,6 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import com.google.common.collect.Table;
 
-import org.apache.doris.transaction.DatabaseTransactionMgr;
-import org.apache.doris.transaction.TransactionState;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -639,13 +638,17 @@ public class TabletScheduler extends MasterDaemon {
      */
     private void handleReplicaMissing(TabletSchedCtx tabletCtx, AgentBatchTask 
batchTask) throws SchedException {
         stat.counterReplicaMissingErr.incrementAndGet();
+        // check compaction too slow file is recovered
+        if (tabletCtx.compactionRecovered()) {
+            return;
+        }
+
         // find proper tag
         Tag tag = chooseProperTag(tabletCtx, true);
         // find an available dest backend and path
         RootPathLoadStatistic destPath = chooseAvailableDestPath(tabletCtx, 
tag, false /* not for colocate */);
         Preconditions.checkNotNull(destPath);
         tabletCtx.setDest(destPath.getBeId(), destPath.getPathHash());
-
         // choose a source replica for cloning from
         tabletCtx.chooseSrcReplica(backendsWorkingSlots, -1);
 
@@ -664,7 +667,7 @@ public class TabletScheduler extends MasterDaemon {
         Map<Tag, Short> currentAllocMap = Maps.newHashMap();
         for (Replica replica : replicas) {
             Backend be = infoService.getBackend(replica.getBackendId());
-            if (be != null && be.isScheduleAvailable() && replica.isAlive()) {
+            if (be != null && be.isScheduleAvailable() && replica.isAlive() && 
!replica.tooSlow()) {
                 Short num = currentAllocMap.getOrDefault(be.getTag(), (short) 
0);
                 currentAllocMap.put(be.getTag(), (short) (num + 1));
             }
@@ -780,6 +783,7 @@ public class TabletScheduler extends MasterDaemon {
         if (deleteBackendDropped(tabletCtx, force)
                 || deleteBadReplica(tabletCtx, force)
                 || deleteBackendUnavailable(tabletCtx, force)
+                || deleteTooSlowReplica(tabletCtx, force)
                 || deleteCloneOrDecommissionReplica(tabletCtx, force)
                 || deleteReplicaWithFailedVersion(tabletCtx, force)
                 || deleteReplicaWithLowerVersion(tabletCtx, force)
@@ -816,6 +820,16 @@ public class TabletScheduler extends MasterDaemon {
         return false;
     }
 
+    private boolean deleteTooSlowReplica(TabletSchedCtx tabletCtx, boolean 
force) throws SchedException {
+        for (Replica replica : tabletCtx.getReplicas()) {
+            if (replica.tooSlow()) {
+                deleteReplicaInternal(tabletCtx, replica, "replica is too 
slow", force);
+                return true;
+            }
+        }
+        return false;
+    }
+
     private boolean deleteBackendUnavailable(TabletSchedCtx tabletCtx, boolean 
force) throws SchedException {
         for (Replica replica : tabletCtx.getReplicas()) {
             Backend be = infoService.getBackend(replica.getBackendId());
@@ -1007,12 +1021,16 @@ public class TabletScheduler extends MasterDaemon {
      * remove the replica which has the most version count, and much more than 
others
      * return true if delete one replica, otherwise, return false.
      */
-    private boolean handleReplicaTooSlow(TabletSchedCtx tabletCtx) throws 
SchedException {
+    private void handleReplicaTooSlow(TabletSchedCtx tabletCtx) throws 
SchedException {
         Replica chosenReplica = null;
         Replica minReplica = null;
         long maxVersionCount = -1;
         long minVersionCount = Integer.MAX_VALUE;
+        int normalReplicaCount = 0;
         for (Replica replica : tabletCtx.getReplicas()) {
+            if (replica.isAlive() && !replica.tooSlow()) {
+                normalReplicaCount++;
+            }
             if (replica.getVersionCount() > maxVersionCount) {
                 maxVersionCount = replica.getVersionCount();
                 chosenReplica = replica;
@@ -1023,17 +1041,15 @@ public class TabletScheduler extends MasterDaemon {
             }
         }
 
-        if (chosenReplica != null && !chosenReplica.equals(minReplica) && 
minReplica.isAlive()) {
-            try {
-                
Catalog.getCurrentCatalog().setReplicaStatus(tabletCtx.getTabletId(), 
chosenReplica.getBackendId(),
-                        Replica.ReplicaStatus.BAD);
-                throw new SchedException(Status.FINISHED, "set slow replica as 
bad");
-            } catch (MetaNotFoundException e) {
-                LOG.warn("set slow replica bad failed:", e);
-                return false;
-            }
+        if (chosenReplica != null && !chosenReplica.equals(minReplica) && 
minReplica.isAlive() && !minReplica.tooSlow()
+                && normalReplicaCount >= 1) {
+            chosenReplica.setState(ReplicaState.COMPACTION_TOO_SLOW);
+            LOG.info("set replica id :{} tablet id: {}, backend id: {} to 
COMPACTION_TOO_SLOW", chosenReplica.getId()
+                    , tabletCtx.getTablet()
+                    .getId(), chosenReplica.getBackendId());
+            throw new SchedException(Status.FINISHED, "set replica to 
COMPACTION_TOO_SLOW");
         }
-        return false;
+        throw new SchedException(Status.FINISHED, "No replica too slow");
     }
 
     private void deleteReplicaInternal(TabletSchedCtx tabletCtx, Replica 
replica, String reason, boolean force) throws SchedException {
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/clone/TabletReplicaTooSlowTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/clone/TabletReplicaTooSlowTest.java
index 875ffe1..2a48e64 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/clone/TabletReplicaTooSlowTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/clone/TabletReplicaTooSlowTest.java
@@ -20,6 +20,7 @@ package org.apache.doris.clone;
 import org.apache.doris.analysis.CreateDbStmt;
 import org.apache.doris.analysis.CreateTableStmt;
 import org.apache.doris.catalog.Catalog;
+import org.apache.doris.catalog.DiskInfo;
 import org.apache.doris.catalog.Replica;
 import org.apache.doris.catalog.TabletInvertedIndex;
 import org.apache.doris.common.Config;
@@ -48,6 +49,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 public class TabletReplicaTooSlowTest {
     private static final Logger LOG = 
LogManager.getLogger(TabletReplicaTooSlowTest.class);
@@ -133,12 +135,15 @@ public class TabletReplicaTooSlowTest {
         for (Table.Cell<Long, Long, Replica> cell : 
replicaMetaTable.cellSet()) {
             long beId = cell.getColumnKey();
             Backend be = Catalog.getCurrentSystemInfo().getBackend(beId);
+            List<Long> pathHashes = 
be.getDisks().values().stream().map(DiskInfo::getPathHash).collect(Collectors.toList());
             if (be == null) {
                 continue;
             }
             Replica replica = cell.getValue();
             replica.setVersionCount(versionCount);
             versionCount = versionCount + 200;
+
+            replica.setPathHash(pathHashes.get(0));
         }
     }
 
@@ -154,23 +159,25 @@ public class TabletReplicaTooSlowTest {
                 ")";
         ExceptionChecker.expectThrowsNoException(() -> createTable(createStr));
         int maxLoop = 300;
-        boolean deleted = true;
+        boolean delete = false;
         while (maxLoop-- > 0) {
             Table<Long, Long, Replica> replicaMetaTable = 
Catalog.getCurrentInvertedIndex().getReplicaMetaTable();
-
+            boolean found = false;
             for (Table.Cell<Long, Long, Replica> cell : 
replicaMetaTable.cellSet()) {
                 Replica replica = cell.getValue();
                 if (replica.getVersionCount() == 401) {
-                    LOG.info("slow replica is not deleted.");
-                    deleted = replica.isBad();
-                    break;
+                    if (replica.tooSlow()) {
+                        LOG.info("set to TOO_SLOW.");
+                    }
+                    found = true;
                 }
             }
-            if (deleted) {
+            if (!found) {
+                delete = true;
                 break;
             }
             Thread.sleep(1000);
         }
-        Assert.assertTrue(deleted);
+        Assert.assertTrue(delete);
     }
 }
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index f69bc51..7c2466a 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -2002,12 +2002,28 @@ public class QueryPlanTest {
                 "\"in_memory\" = \"false\",\n" +
                 "\"storage_format\" = \"V2\"\n" +
                 ")");
+        createTable("CREATE TABLE issue7971.`t1` (\n" +
+                "  `k1` tinyint(4) NULL COMMENT \"\",\n" +
+                "  `k21` smallint(6) NULL COMMENT \"\",\n" +
+                "  `k31` smallint(6) NULL COMMENT \"\"\n" +
+                ") ENGINE=OLAP\n" +
+                "DUPLICATE KEY(`k1`)\n" +
+                "COMMENT \"OLAP\"\n" +
+                "DISTRIBUTED BY HASH(`k1`) BUCKETS 1\n" +
+                "PROPERTIES (\n" +
+                "\"replication_allocation\" = \"tag.location.default: 1\",\n" +
+                "\"in_memory\" = \"false\",\n" +
+                "\"storage_format\" = \"V2\"\n" +
+                ")");
         String sql = "SELECT k1, k2, GROUPING(k1), GROUPING(k2), SUM(k3) FROM 
issue7971.t GROUP BY GROUPING SETS ( (k1, k2), (k2), (k1), ( ) );";
         String explainStr = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, 
sql);
         Assert.assertTrue(explainStr.contains("REPEAT_NODE"));
         sql = "SELECT k1 ,GROUPING(k2) FROM issue7971.t GROUP BY CUBE (k1) 
ORDER BY k1;";
         explainStr = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
         Assert.assertTrue(explainStr.contains("errCode = 2"));
+        sql = "select grouping_id(t1.k1), t1.k1, max(k2) from issue7971.t left 
join issue7971.t1 on t.k3 = t1.k1 group by grouping sets ((k1), ());";
+        explainStr = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
+        Assert.assertTrue(explainStr.contains("REPEAT_NODE"));
     }
 
     @Test

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to