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

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

commit 287f7521789862f650721a29837cb5484fed7a9e
Author: zhangstar333 <[email protected]>
AuthorDate: Tue Jun 9 22:40:15 2026 +0800

    [bug](iceberg) mapping iceberg varint type to unsupported type
---
 .../scripts/create_preinstalled_scripts/iceberg/run30.sql     | 11 +++++++++++
 .../org/apache/doris/datasource/iceberg/IcebergUtils.java     |  2 ++
 .../data/external_table_p0/iceberg/test_iceberg_varbinary.out |  2 ++
 .../external_table_p0/iceberg/test_iceberg_varbinary.groovy   | 11 +++++++++++
 4 files changed, 26 insertions(+)

diff --git 
a/docker/thirdparties/docker-compose/iceberg/scripts/create_preinstalled_scripts/iceberg/run30.sql
 
b/docker/thirdparties/docker-compose/iceberg/scripts/create_preinstalled_scripts/iceberg/run30.sql
new file mode 100644
index 00000000000..93e0419496f
--- /dev/null
+++ 
b/docker/thirdparties/docker-compose/iceberg/scripts/create_preinstalled_scripts/iceberg/run30.sql
@@ -0,0 +1,11 @@
+create database if not exists demo.test_db;
+use demo.test_db;
+CREATE TABLE test_variant_repro (
+    id INT,
+    v VARIANT
+)
+USING iceberg
+TBLPROPERTIES (
+    'format-version' = '3',
+    'write.format.default' = 'parquet'
+);
\ No newline at end of file
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java
index 932bb8b86da..bf1bee501bc 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java
@@ -636,6 +636,8 @@ public class IcebergUtils {
                                 icebergTypeToDorisType(x.type(), 
enableMappingVarbinary, enableMappingTimestampTz)))
                         .collect(Collectors.toCollection(ArrayList::new));
                 return new StructType(nestedTypes);
+            case VARIANT:
+                return Type.UNSUPPORTED;
             default:
                 throw new IllegalArgumentException("Cannot transform unknown 
type: " + type);
         }
diff --git 
a/regression-test/data/external_table_p0/iceberg/test_iceberg_varbinary.out 
b/regression-test/data/external_table_p0/iceberg/test_iceberg_varbinary.out
index 3d224775383..65a20f0fb7c 100644
--- a/regression-test/data/external_table_p0/iceberg/test_iceberg_varbinary.out
+++ b/regression-test/data/external_table_p0/iceberg/test_iceberg_varbinary.out
@@ -92,3 +92,5 @@
 -- !select23 --
 1      a       0x0FF102FDFEFF
 
+-- !select23 --
+
diff --git 
a/regression-test/suites/external_table_p0/iceberg/test_iceberg_varbinary.groovy
 
b/regression-test/suites/external_table_p0/iceberg/test_iceberg_varbinary.groovy
index 9152e12e92f..a5f091298a7 100644
--- 
a/regression-test/suites/external_table_p0/iceberg/test_iceberg_varbinary.groovy
+++ 
b/regression-test/suites/external_table_p0/iceberg/test_iceberg_varbinary.groovy
@@ -161,4 +161,15 @@ suite("test_iceberg_varbinary", "p0,external") {
     qt_select23 """
         select * from binary_partitioned_table where 
from_hex(partition_bin)="0FF102FDFEFF";
     """
+
+    sql """ use test_db; """
+    qt_select23 """
+        select id from test_variant_repro;
+    """
+    test {
+        sql """
+            select * from test_variant_repro;
+        """
+        exception "UNSUPPORTED"
+    }
 }


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

Reply via email to