Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,12 @@ private void createOlapTable(Database db, CreateTableStmt stmt) throws UserExcep
Preconditions.checkNotNull(distributionDesc);
DistributionInfo defaultDistributionInfo = distributionDesc.toDistributionInfo(baseSchema);

if (defaultDistributionInfo instanceof HashDistributionInfo
&& ((HashDistributionInfo) defaultDistributionInfo).getDistributionColumns()
.stream().anyMatch(column -> column.getType().isVariantType())) {
throw new DdlException("Hash distribution info should not contain variant columns");
}

// calc short key column count
short shortKeyColumnCount = Env.calcShortKeyColumnCount(baseSchema, stmt.getProperties(), isKeysRequired);
if (LOG.isDebugEnabled()) {
Expand Down
12 changes: 12 additions & 0 deletions regression-test/suites/variant_p0/load.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,18 @@ suite("regression_test_variant", "nonConcurrent"){
exception("errCode = 2, detailMessage = Doris hll, bitmap, array, map, struct, jsonb, variant column must use with specific function, and don't support filter, group by or order by")
}

test {
sql """
create table var(
`content` variant
)distributed by hash(`content`) buckets 8
properties(
"replication_allocation" = "tag.location.default: 1"
);
"""
exception("errCode = 2, detailMessage = Hash distribution info should not contain variant columns")
}

// 13. sparse columns
table_name = "sparse_columns"
create_table table_name
Expand Down