Skip to content

Commit

Permalink
[Bug](Variant) forbit variant column with filter, group by or order by
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Mar 27, 2024
1 parent 9c6180d commit 5ecc3db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public boolean isStructType() {
}

public boolean isOnlyMetricType() {
return isObjectType() || isComplexType() || isJsonType();
return isObjectType() || isComplexType() || isJsonType() || isVariantType();
}

public boolean isObjectType() {
Expand Down
6 changes: 5 additions & 1 deletion regression-test/suites/variant_p0/load.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ suite("regression_test_variant", "nonConcurrent"){
// b? 7.111 [123,{"xx":1}] {"b":{"c":456,"e":7.111}} 456
qt_sql_30 "select v['b']['e'], v['a'], v['b'], v['b']['c'] from jsonb_values where cast(v['b']['e'] as double) > 1;"

test {
sql "select v['a'] from ${table_name} group by v['a']"
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")
}

// 13. sparse columns
table_name = "sparse_columns"
create_table table_name
Expand Down Expand Up @@ -327,7 +332,6 @@ suite("regression_test_variant", "nonConcurrent"){
sql """UPDATE ${table_name} set v = '{"updated_value" : 10}' where k = 2"""
qt_sql_36_3 """select * from ${table_name} where k = 2"""


// delete sign
load_json_data.call(table_name, """delete.json""")

Expand Down

0 comments on commit 5ecc3db

Please sign in to comment.