This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 dbf7a765921 Revert "[Chore](rollup) check duplicate column name when
create table with rollup (#34827)"
dbf7a765921 is described below
commit dbf7a76592100f8c7f56769f74900e38d614f015
Author: yiguolei <[email protected]>
AuthorDate: Wed May 22 10:19:51 2024 +0800
Revert "[Chore](rollup) check duplicate column name when create table with
rollup (#34827)"
This reverts commit 4a8df535537e8eab8fa2ad54934a185e17d4e660.
---
.../trees/plans/commands/info/CreateTableInfo.java | 4 ----
.../plans/commands/info/RollupDefinition.java | 14 +------------
.../test_mv_useless/test_dup_mv_useless.groovy | 23 ----------------------
.../suites/nereids_p0/create_table/ddl/table.sql | 2 +-
4 files changed, 2 insertions(+), 41 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
index 3d4607517d9..6456e31a5df 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
@@ -460,10 +460,6 @@ public class CreateTableInfo {
}
}
}
-
- for (RollupDefinition rollup : rollups) {
- rollup.validate();
- }
} else {
// mysql, broker and hive do not need key desc
if (keysType != null) {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/RollupDefinition.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/RollupDefinition.java
index b01e380e904..6c3857279f5 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/RollupDefinition.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/RollupDefinition.java
@@ -18,15 +18,12 @@
package org.apache.doris.nereids.trees.plans.commands.info;
import org.apache.doris.analysis.AddRollupClause;
-import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.util.Utils;
import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* rollup definition
@@ -44,16 +41,7 @@ public class RollupDefinition {
this.properties = Maps.newHashMap(properties);
}
- /**
- * check rollup validity
- */
- public void validate() throws AnalysisException {
- Set<String> colSet = Sets.newHashSet();
- for (String col : cols) {
- if (!colSet.add(col)) {
- throw new AnalysisException("rollup has duplicate column name
" + col);
- }
- }
+ public void validate() {
}
public AddRollupClause translateToCatalogStyle() {
diff --git
a/regression-test/suites/mv_p0/test_mv_useless/test_dup_mv_useless.groovy
b/regression-test/suites/mv_p0/test_mv_useless/test_dup_mv_useless.groovy
index d91cafbe93d..7640b6e1806 100644
--- a/regression-test/suites/mv_p0/test_mv_useless/test_dup_mv_useless.groovy
+++ b/regression-test/suites/mv_p0/test_mv_useless/test_dup_mv_useless.groovy
@@ -48,27 +48,4 @@ suite ("test_dup_mv_useless") {
createMV("create materialized view k1_k2_u21 as select k2,k1 from
${testTable} group by k2,k1 order by k2,k1;")
createMV("create materialized view k1_k2_sumk3 as select k1,k2,sum(k3)
from ${testTable} group by k1,k2;")
sql "insert into ${testTable} select 4,4,4;"
-
- test {
- sql """
- create table test_rollup (
- `id` int not null,
- `kbool` boolean not null,
- `ktint` tinyint(4) not null,
- `ksint` smallint(6) not null,
- `kint` int(11) not null,
- `kbint` bigint(20) not null,
- `klint` largeint(40) not null
- ) engine=OLAP
- duplicate key(id, kbool, ktint)
- distributed by random buckets auto
- rollup (
- r1 (id, ktint, kbool, ktint, kbint) duplicate key(id)
- )
- properties (
- "replication_num"="1"
- );
- """
- exception "duplicate column name"
- }
}
diff --git a/regression-test/suites/nereids_p0/create_table/ddl/table.sql
b/regression-test/suites/nereids_p0/create_table/ddl/table.sql
index c1f24407178..bcac1168b73 100644
--- a/regression-test/suites/nereids_p0/create_table/ddl/table.sql
+++ b/regression-test/suites/nereids_p0/create_table/ddl/table.sql
@@ -238,7 +238,7 @@ create table test_rollup (
duplicate key(id, kbool, ktint)
distributed by random buckets auto
rollup (
- r1 (id, ktint, kbool, kbint) duplicate key(id)
+ r1 (id, ktint, kbool, ktint, kbint) duplicate key(id)
)
properties (
"replication_num"="1"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]