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

junhao 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 f0b864bcea [spark] Fix DescriptorToStringFunction (#7127)
f0b864bcea is described below

commit f0b864bceafa74c385f8549d63d27dedbba522d5
Author: Zouxxyy <[email protected]>
AuthorDate: Tue Jan 27 12:52:41 2026 +0800

    [spark] Fix DescriptorToStringFunction (#7127)
---
 docs/content/spark/sql-functions.md                                  | 1 +
 .../org/apache/paimon/spark/function/DescriptorToStringUnbound.java  | 2 +-
 .../src/test/scala/org/apache/paimon/spark/sql/BlobTestBase.scala    | 5 +++++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/docs/content/spark/sql-functions.md 
b/docs/content/spark/sql-functions.md
index bf04badf75..e18ebb0f67 100644
--- a/docs/content/spark/sql-functions.md
+++ b/docs/content/spark/sql-functions.md
@@ -93,6 +93,7 @@ Converts a blob descriptor (BINARY) to its string 
representation (STRING). This
 ```sql
 -- Convert a blob descriptor to string for inspection
 SELECT sys.descriptor_to_string(content) FROM t WHERE id = '1';
+-- [BlobDescriptor{version=1', 
uri='/path/to/data-2c103f6f-3857-4062-abc3-2e260374a68e-1.blob', offset=4, 
length=1048576}]
 ```
 
 ## User-defined Function
diff --git 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/function/DescriptorToStringUnbound.java
 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/function/DescriptorToStringUnbound.java
index 05da656129..d6b8413224 100644
--- 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/function/DescriptorToStringUnbound.java
+++ 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/function/DescriptorToStringUnbound.java
@@ -40,7 +40,7 @@ public class DescriptorToStringUnbound implements 
UnboundFunction {
                             + inputType.fields()[0].dataType().simpleString());
         }
 
-        return new PathToDescriptorFunction();
+        return new DescriptorToStringFunction();
     }
 
     @Override
diff --git 
a/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/BlobTestBase.scala
 
b/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/BlobTestBase.scala
index 2cdd156e7f..08c874cd3b 100644
--- 
a/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/BlobTestBase.scala
+++ 
b/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/BlobTestBase.scala
@@ -183,6 +183,11 @@ class BlobTestBase extends PaimonSparkTestBase {
       val blob = 
Blob.fromDescriptor(uriReaderFactory.create(newBlobDescriptor.uri), 
blobDescriptor)
       assert(util.Arrays.equals(blobData, blob.toData))
 
+      checkAnswer(
+        sql("SELECT sys.descriptor_to_string(content) FROM t"),
+        Seq(Row(newBlobDescriptor.toString))
+      )
+
       sql("ALTER TABLE t SET TBLPROPERTIES ('blob-as-descriptor'='false')")
       checkAnswer(
         sql("SELECT id, name, content, _ROW_ID, _SEQUENCE_NUMBER FROM t WHERE 
id = 1"),

Reply via email to