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

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


The following commit(s) were added to refs/heads/master by this push:
     new e274652d78 [lance] Reject unsupported VARIANT and BLOB types in 
LanceFileFormat schema validation (#9150)
e274652d78 is described below

commit e274652d78f9c6495554af3bcb297f1eb7e141f8
Author: Eunbin Son <[email protected]>
AuthorDate: Mon Aug 10 22:18:03 2026 +0900

    [lance] Reject unsupported VARIANT and BLOB types in LanceFileFormat schema 
validation (#9150)
---
 .../org/apache/paimon/format/lance/LanceFileFormat.java  |  5 +++--
 .../apache/paimon/format/lance/LanceFileFormatTest.java  | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git 
a/paimon-lance/src/main/java/org/apache/paimon/format/lance/LanceFileFormat.java
 
b/paimon-lance/src/main/java/org/apache/paimon/format/lance/LanceFileFormat.java
index 05005432b6..2eee2639b7 100644
--- 
a/paimon-lance/src/main/java/org/apache/paimon/format/lance/LanceFileFormat.java
+++ 
b/paimon-lance/src/main/java/org/apache/paimon/format/lance/LanceFileFormat.java
@@ -180,12 +180,13 @@ public class LanceFileFormat extends FileFormat {
 
         @Override
         public Void visit(VariantType variantType) {
-            return null;
+            throw new UnsupportedOperationException(
+                    "Lance file format does not support type VARIANT");
         }
 
         @Override
         public Void visit(BlobType blobType) {
-            return null;
+            throw new UnsupportedOperationException("Lance file format does 
not support type BLOB");
         }
 
         @Override
diff --git 
a/paimon-lance/src/test/java/org/apache/paimon/format/lance/LanceFileFormatTest.java
 
b/paimon-lance/src/test/java/org/apache/paimon/format/lance/LanceFileFormatTest.java
index 2352be764f..9a7152e259 100644
--- 
a/paimon-lance/src/test/java/org/apache/paimon/format/lance/LanceFileFormatTest.java
+++ 
b/paimon-lance/src/test/java/org/apache/paimon/format/lance/LanceFileFormatTest.java
@@ -101,4 +101,20 @@ public class LanceFileFormatTest {
         // Validate that no exception is thrown for supported types
         assertDoesNotThrow(() -> format.validateDataFields(rowType));
     }
+
+    @Test
+    public void testValidateDataFields_UnsupportedVariantType() {
+        LanceFileFormat format =
+                new LanceFileFormat(new FileFormatFactory.FormatContext(new 
Options(), 1024, 1024));
+        RowType rowType = RowType.of(DataTypes.VARIANT());
+        assertThrows(UnsupportedOperationException.class, () -> 
format.validateDataFields(rowType));
+    }
+
+    @Test
+    public void testValidateDataFields_UnsupportedBlobType() {
+        LanceFileFormat format =
+                new LanceFileFormat(new FileFormatFactory.FormatContext(new 
Options(), 1024, 1024));
+        RowType rowType = RowType.of(DataTypes.BLOB());
+        assertThrows(UnsupportedOperationException.class, () -> 
format.validateDataFields(rowType));
+    }
 }

Reply via email to