[fix](Variant Type) Fixes the desc failure (#28343)

fix the desc failure when there is no decomposition of columns in the variant column.
This commit is contained in:
Sun Chenyang
2023-12-14 13:20:43 +08:00
committed by GitHub
parent 79f03d6fde
commit e5a57f82ec
4 changed files with 20 additions and 6 deletions

View File

@ -68,9 +68,6 @@ public class RemoteIndexSchemaProcDir implements ProcDirInterface {
table.readUnlock();
}
List<Column> remoteSchema = new FetchRemoteTabletSchemaUtil(tablets).fetch();
if (remoteSchema == null || remoteSchema.isEmpty()) {
throw new AnalysisException("fetch remote tablet schema failed");
}
this.schema.addAll(remoteSchema);
return IndexSchemaProcNode.createResult(this.schema, this.bfColumns);
}

View File

@ -63,9 +63,6 @@ public class RemoteIndexSchemaProcNode implements ProcNodeInterface {
}
}
List<Column> remoteSchema = new FetchRemoteTabletSchemaUtil(tablets).fetch();
if (remoteSchema == null || remoteSchema.isEmpty()) {
throw new AnalysisException("fetch remote tablet schema failed");
}
this.schema.addAll(remoteSchema);
return IndexSchemaProcNode.createResult(this.schema, this.bfColumns);
}

View File

@ -194,3 +194,7 @@ v.画像.丬文 TEXT Yes false \N
v.画像.地址 TEXT Yes false \N
v.金额 SMALLINT Yes false \N
-- !sql_12 --
k BIGINT Yes true \N
v VARIANT Yes false \N NONE

View File

@ -217,6 +217,22 @@ suite("regression_test_variant_desc", "nonConcurrent"){
sql """ insert into ${table_name} values (0, '{"名字" : "jack", "!@#^&*()": "11111", "金额" : 200, "画像" : {"地址" : "北京", "\\\u4E2C\\\u6587": "unicode"}}')"""
sql """set describe_extend_variant_column = true"""
qt_sql_11 """desc ${table_name}"""
// varaint subcolumn: empty
table_name = "no_subcolumn_table"
sql """
CREATE TABLE IF NOT EXISTS ${table_name} (
k bigint,
v variant
)
DUPLICATE KEY(`k`)
DISTRIBUTED BY HASH(k) BUCKETS 5
properties("replication_num" = "1", "disable_auto_compaction" = "false");
"""
sql """ insert into ${table_name} values (0, '{}')"""
sql """ insert into ${table_name} values (0, '100')"""
sql """set describe_extend_variant_column = true"""
qt_sql_12 """desc ${table_name}"""
} finally {
// reset flags
set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "0.95")