This is an automated email from the ASF dual-hosted git repository.

jianliangqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ed59e3a07c2 [Bug](Variant) forbit variant column with filter, group by 
or order by (#32884)
ed59e3a07c2 is described below

commit ed59e3a07c2118952c3a0f36977e1022e168aa07
Author: lihangyu <[email protected]>
AuthorDate: Mon Apr 1 10:35:37 2024 +0800

    [Bug](Variant) forbit variant column with filter, group by or order by 
(#32884)
---
 .../src/main/java/org/apache/doris/nereids/types/DataType.java      | 2 +-
 regression-test/suites/variant_p0/load.groovy                       | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

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 e9905a44a41..28ab39e1b1c 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
@@ -620,7 +620,7 @@ public abstract class DataType {
     }
 
     public boolean isOnlyMetricType() {
-        return isObjectType() || isComplexType() || isJsonType();
+        return isObjectType() || isComplexType() || isJsonType() || 
isVariantType();
     }
 
     public boolean isObjectType() {
diff --git a/regression-test/suites/variant_p0/load.groovy 
b/regression-test/suites/variant_p0/load.groovy
index 9b1d483782d..3f3609ec877 100644
--- a/regression-test/suites/variant_p0/load.groovy
+++ b/regression-test/suites/variant_p0/load.groovy
@@ -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
@@ -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""")
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to