You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by vh...@apache.org on 2026/09/12 02:27:10 UTC

(hudi) branch master updated: test(spark): reference disjoint blob ranges in Lance out-of-line test (#19916)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new b3dfb2a125f6 test(spark): reference disjoint blob ranges in Lance out-of-line test (#19916)
b3dfb2a125f6 is described below

commit b3dfb2a125f6c4665500cfb4331a24c1260782f1
Author: voonhous <vo...@gmail.com>
AuthorDate: Sat Sep 12 10:27:02 2026 +0800

    test(spark): reference disjoint blob ranges in Lance out-of-line test (#19916)
    
    TestLanceDataSource#testBlobOutOfLine pointed two rows at [0, 1024) and
    [0, 512) of one external file. A blob is a distinct entity and two blobs
    never share bytes, so BatchedBlobReader rejects the pair whenever both
    rows land in the same Spark task. At the harness's four shuffle
    partitions they never did; at two (#19906) every case failed.
    
    Grow blob_file_2.bin to 1536 bytes and point row 4 at [1024, 1536).
    
    Context: #19911
---
 .../scala/org/apache/hudi/functional/TestLanceDataSource.scala   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestLanceDataSource.scala b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestLanceDataSource.scala
index 532968ec1fc9..ed54f0fc3c8b 100644
--- a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestLanceDataSource.scala
+++ b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestLanceDataSource.scala
@@ -1806,15 +1806,18 @@ class TestLanceDataSource extends HoodieSparkClientTestBase {
     val externalDir = Files.createDirectories(
       Paths.get(s"$basePath/_blob_ext${modeSuffix}_${tableType.name().toLowerCase}"))
     val filePath1 = BlobTestHelpers.createTestFile(externalDir, "blob_file_1.bin", 1024)
-    val filePath2 = BlobTestHelpers.createTestFile(externalDir, "blob_file_2.bin", 1024)
+    val filePath2 = BlobTestHelpers.createTestFile(externalDir, "blob_file_2.bin", 1536)
 
     val sparkSess = spark
     import sparkSess.implicits._
+    // Every row references a disjoint range. A blob is a distinct entity (#18098), so
+    // BatchedBlobReader rejects overlapping ranges within a task, and which rows share a
+    // task depends only on partitioning.
     val baseDf = Seq(
       (1, filePath1, 0L, 256L),
       (2, filePath1, 256L, 256L),
       (3, filePath2, 0L, 1024L),
-      (4, filePath2, 0L, 512L)
+      (4, filePath2, 1024L, 512L)
     ).toDF("id", "path", "offset", "length")
     val rawDf = baseDf.select($"id",
       BlobTestHelpers.blobStructCol("payload", $"path", $"offset", $"length"))
@@ -1860,7 +1863,7 @@ class TestLanceDataSource extends HoodieSparkClientTestBase {
       s"SELECT id, read_blob(payload) AS bytes FROM $viewName ORDER BY id").collect()
     assertEquals(4, materialized.length)
 
-    val expectedRanges = Map(1 -> 0L, 2 -> 256L, 3 -> 0L, 4 -> 0L)
+    val expectedRanges = Map(1 -> 0L, 2 -> 256L, 3 -> 0L, 4 -> 1024L)
     val expectedLengths = Map(1 -> 256, 2 -> 256, 3 -> 1024, 4 -> 512)
     materialized.foreach { row =>
       val id = row.getInt(row.fieldIndex("id"))