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

eldenmoon 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 7ace3ff6de9 [branch-2.1](pick) pick 2 prs about nereids create variant 
table (#33125)
7ace3ff6de9 is described below

commit 7ace3ff6de95af805343a5177b1759a963d00804
Author: lihangyu <[email protected]>
AuthorDate: Mon Apr 1 19:00:39 2024 +0800

    [branch-2.1](pick) pick 2 prs about nereids create variant table (#33125)
    
    * [fix](Nereids) support variant column with index when create table 
(#32948)
    
    * [opt](Nereids) support create table with variant type (#32953)
    
    ---------
    
    Co-authored-by: morrySnow <[email protected]>
---
 fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4     | 1 +
 fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4    | 1 +
 .../doris/nereids/trees/plans/commands/info/IndexDefinition.java      | 4 ++--
 fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java | 3 +++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4 
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
index 256888c2fc1..33354199e67 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
@@ -548,6 +548,7 @@ VALUE: 'VALUE';
 VALUES: 'VALUES';
 VARCHAR: 'VARCHAR';
 VARIABLES: 'VARIABLES';
+VARIANT: 'VARIANT';
 VERBOSE: 'VERBOSE';
 VERSION: 'VERSION';
 VIEW: 'VIEW';
diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
index acc6eecb51a..0fbb0a1f960 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
@@ -899,6 +899,7 @@ primitiveColType:
     | type=DECIMALV3
     | type=IPV4
     | type=IPV6
+    | type=VARIANT
     | type=ALL
     ;
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java
index ba56cfa4a8b..09c670e1b8e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java
@@ -105,8 +105,8 @@ public class IndexDefinition {
             }
             if (!(colType.isDateLikeType() || colType.isDecimalLikeType()
                     || colType.isIntegralType() || colType.isStringLikeType()
-                    || colType.isBooleanType())) {
-                // TODO add colType.isVariantType() and colType.isAggState()
+                    || colType.isBooleanType() || colType.isVariantType())) {
+                // TODO add colType.isAggState()
                 throw new AnalysisException(colType + " is not supported in " 
+ indexType.toString()
                         + " index. " + "invalid index: " + name);
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
index 11bacf091c3..28ab39e1b1c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
@@ -297,6 +297,9 @@ public abstract class DataType {
             case "ipv6":
                 dataType = IPv6Type.INSTANCE;
                 break;
+            case "variant":
+                dataType = VariantType.INSTANCE;
+                break;
             default:
                 throw new AnalysisException("Nereids do not support type: " + 
type);
         }


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

Reply via email to