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 256888c2fc1409..33354199e67abd 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 acc6eecb51aa72..0fbb0a1f960848 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 ba56cfa4a8bba9..09c670e1b8e934 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 void checkColumn(ColumnDefinition column, KeysType keysType, } 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 11bacf091c3783..28ab39e1b1c138 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 static DataType convertPrimitiveFromStrings(List types, boolean u case "ipv6": dataType = IPv6Type.INSTANCE; break; + case "variant": + dataType = VariantType.INSTANCE; + break; default: throw new AnalysisException("Nereids do not support type: " + type); }