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

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 9bf402d86af branch-4.0: [fix](inverted index) support dict_compression 
configuration for variant type #56399 (#56435)
9bf402d86af is described below

commit 9bf402d86af175e7ccfbd4c2eacfb481c3d0205c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Sep 27 09:44:28 2025 +0800

    branch-4.0: [fix](inverted index) support dict_compression configuration 
for variant type #56399 (#56435)
    
    Cherry-picked from #56399
    
    Co-authored-by: zzzxl <[email protected]>
---
 .../apache/doris/analysis/InvertedIndexUtil.java   |  2 +-
 .../test_inverted_index_v3.groovy                  | 28 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/InvertedIndexUtil.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/InvertedIndexUtil.java
index f1e73c75ca8..1f723647784 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/InvertedIndexUtil.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/InvertedIndexUtil.java
@@ -316,7 +316,7 @@ public class InvertedIndexUtil {
         }
 
         if (dictCompression != null) {
-            if (!colType.isStringType()) {
+            if (!colType.isStringType() && !colType.isVariantType()) {
                 throw new AnalysisException("dict_compression can only be set 
for StringType columns. type: "
                         + colType);
             }
diff --git 
a/regression-test/suites/inverted_index_p0/test_inverted_index_v3.groovy 
b/regression-test/suites/inverted_index_p0/test_inverted_index_v3.groovy
index 82389d84e3c..6ee92c4083b 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_v3.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_v3.groovy
@@ -140,4 +140,32 @@ suite("test_inverted_index_v3", "p0"){
 
     } finally {
     }
+
+    sql """
+      CREATE TABLE `t1` (
+        `id` int NOT NULL,
+        `v` variant<MATCH_NAME_GLOB 
'key':text,properties("variant_max_subcolumns_count" = "3")> ,
+        INDEX idx_v (`v`) USING INVERTED PROPERTIES("dict_compression" = 
"true", "lower_case" = "true", "parser" = "unicode", "support_phrase" = "true", 
"field_pattern" = "key")
+      ) ENGINE=OLAP
+      DUPLICATE KEY(`id`)
+      DISTRIBUTED BY HASH(`id`) BUCKETS 1
+      PROPERTIES (
+      "replication_allocation" = "tag.location.default: 1",
+      "inverted_index_storage_format" = "V3"
+      );
+    """
+
+    sql """
+      CREATE TABLE `t2` (
+        `id` int NOT NULL,
+        `v` variant,
+        INDEX idx_v (`v`) USING INVERTED PROPERTIES("dict_compression" = 
"true", "lower_case" = "true", "parser" = "unicode", "support_phrase" = "true")
+      ) ENGINE=OLAP
+      DUPLICATE KEY(`id`)
+      DISTRIBUTED BY HASH(`id`) BUCKETS 1
+      PROPERTIES (
+      "replication_allocation" = "tag.location.default: 1",
+      "inverted_index_storage_format" = "V3"
+      );
+    """
 }
\ No newline at end of file


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

Reply via email to