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 5952c0105a [core] Require database for blob view serialization (#8095)
5952c0105a is described below

commit 5952c0105a7743c04910aa52ba736959bc2e957b
Author: YeJunHao <[email protected]>
AuthorDate: Wed Jun 3 16:52:48 2026 +0800

    [core] Require database for blob view serialization (#8095)
---
 .../src/main/java/org/apache/paimon/data/BlobViewStruct.java  |  6 ++++++
 .../test/java/org/apache/paimon/data/BlobViewStructTest.java  | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git 
a/paimon-common/src/main/java/org/apache/paimon/data/BlobViewStruct.java 
b/paimon-common/src/main/java/org/apache/paimon/data/BlobViewStruct.java
index f16daa9210..b5a98468a6 100644
--- a/paimon-common/src/main/java/org/apache/paimon/data/BlobViewStruct.java
+++ b/paimon-common/src/main/java/org/apache/paimon/data/BlobViewStruct.java
@@ -26,6 +26,7 @@ import java.nio.ByteOrder;
 import java.util.Objects;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.paimon.catalog.Identifier.UNKNOWN_DATABASE;
 
 /**
  * Serialized metadata for a BLOB view field.
@@ -64,6 +65,11 @@ public class BlobViewStruct implements Serializable {
     }
 
     public byte[] serialize() {
+        if (UNKNOWN_DATABASE.equals(identifier.getDatabaseName())) {
+            throw new IllegalArgumentException(
+                    "Blob view upstream table identifier must include database 
name: "
+                            + identifier.getFullName());
+        }
         byte[] identifierBytes = identifier.getFullName().getBytes(UTF_8);
 
         int totalSize = 1 + 8 + 4 + identifierBytes.length + 4 + 8;
diff --git 
a/paimon-common/src/test/java/org/apache/paimon/data/BlobViewStructTest.java 
b/paimon-common/src/test/java/org/apache/paimon/data/BlobViewStructTest.java
index 058876219f..0d40c1fe30 100644
--- a/paimon-common/src/test/java/org/apache/paimon/data/BlobViewStructTest.java
+++ b/paimon-common/src/test/java/org/apache/paimon/data/BlobViewStructTest.java
@@ -40,6 +40,17 @@ public class BlobViewStructTest {
         assertThat(deserialized.rowId()).isEqualTo(5L);
     }
 
+    @Test
+    public void testRejectUnknownDatabase() {
+        BlobViewStruct viewStruct =
+                new 
BlobViewStruct(Identifier.create(Identifier.UNKNOWN_DATABASE, "source"), 7, 5L);
+
+        assertThatThrownBy(viewStruct::serialize)
+                .isInstanceOf(IllegalArgumentException.class)
+                .hasMessageContaining(
+                        "Blob view upstream table identifier must include 
database name");
+    }
+
     @Test
     public void testRejectUnexpectedVersion() {
         BlobViewStruct viewStruct =

Reply via email to