Skip to content

Commit

Permalink
[branch-2.1](pick) pick 2 prs about nereids create variant table (#33125
Browse files Browse the repository at this point in the history
)

* [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]>
  • Loading branch information
eldenmoon and morrySnow authored Apr 1, 2024
1 parent bec153b commit 7ace3ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ VALUE: 'VALUE';
VALUES: 'VALUES';
VARCHAR: 'VARCHAR';
VARIABLES: 'VARIABLES';
VARIANT: 'VARIANT';
VERBOSE: 'VERBOSE';
VERSION: 'VERSION';
VIEW: 'VIEW';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ primitiveColType:
| type=DECIMALV3
| type=IPV4
| type=IPV6
| type=VARIANT
| type=ALL
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ public static DataType convertPrimitiveFromStrings(List<String> 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);
}
Expand Down

0 comments on commit 7ace3ff

Please sign in to comment.