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 2025/04/21 06:50:01 UTC

(hudi) branch release-1.0.2 updated (21c32795f6e -> d1cdcb1c569)

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

vhs pushed a change to branch release-1.0.2
in repository https://gitbox.apache.org/repos/asf/hudi.git


    from 21c32795f6e [HUDI-9326] Replace the usage of RewriteAvroPayload with HoodieAvroIndexedRecord (#13180)
     new 4dc1f59d98d [HUDI-9325] Fix HFile reader to account for fake first key in the block index (#13179)
     new d1cdcb1c569 [MINOR] Remove spark2 bundle form validate staged bundles script (#13187)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../io/storage/HoodieNativeAvroHFileReader.java    |   6 +-
 .../io/hadoop/TestHoodieHFileReaderWriterBase.java |  59 ++++++-
 ..._2_4_13_avro_simple_schema_fake_first_key.hfile | Bin 0 -> 460523 bytes
 .../org/apache/hudi/io/hfile/BlockIndexEntry.java  |   5 +
 .../org/apache/hudi/io/hfile/HFileDataBlock.java   |  26 ++-
 .../java/org/apache/hudi/io/hfile/HFileReader.java |  48 ++++--
 .../org/apache/hudi/io/hfile/HFileReaderImpl.java  |  34 ++--
 .../org/apache/hudi/io/hfile/TestHFileReader.java  | 191 ++++++++++++++++++---
 ...hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile | Bin 0 -> 115796 bytes
 scripts/release/validate_staged_bundles.sh         |   2 +-
 10 files changed, 308 insertions(+), 63 deletions(-)
 create mode 100644 hudi-hadoop-common/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_avro_simple_schema_fake_first_key.hfile
 create mode 100644 hudi-io/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile


(hudi) 01/02: [HUDI-9325] Fix HFile reader to account for fake first key in the block index (#13179)

Posted by vh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vhs pushed a commit to branch release-1.0.2
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 4dc1f59d98d439eca962ecff19e47a9f212e732b
Author: Y Ethan Guo <et...@gmail.com>
AuthorDate: Sun Apr 20 22:46:14 2025 -0700

    [HUDI-9325] Fix HFile reader to account for fake first key in the block index (#13179)
    
    (cherry picked from commit 70cdddda22dc0f7e8262505c0fd2ecb50bc0ef42)
---
 .../io/storage/HoodieNativeAvroHFileReader.java    |   6 +-
 .../io/hadoop/TestHoodieHFileReaderWriterBase.java |  59 ++++++-
 ..._2_4_13_avro_simple_schema_fake_first_key.hfile | Bin 0 -> 460523 bytes
 .../org/apache/hudi/io/hfile/BlockIndexEntry.java  |   5 +
 .../org/apache/hudi/io/hfile/HFileDataBlock.java   |  26 ++-
 .../java/org/apache/hudi/io/hfile/HFileReader.java |  48 ++++--
 .../org/apache/hudi/io/hfile/HFileReaderImpl.java  |  34 ++--
 .../org/apache/hudi/io/hfile/TestHFileReader.java  | 191 ++++++++++++++++++---
 ...hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile | Bin 0 -> 115796 bytes
 9 files changed, 307 insertions(+), 62 deletions(-)

diff --git a/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java b/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java
index 37845c9e47e..f594ee429fe 100644
--- a/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java
+++ b/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java
@@ -516,8 +516,7 @@ public class HoodieNativeAvroHFileReader extends HoodieAvroHFileReaderImplBase {
             return Collections.emptyIterator();
           } else {
             // Prefix is greater than the current key. Call seekTo to move the cursor.
-            int val = reader.seekTo(lookUpKeyPrefix);
-            if (val >= 1) {
+            if (reader.seekTo(lookUpKeyPrefix) >= HFileReader.SEEK_TO_IN_RANGE) {
               // Try moving to next entry, matching the prefix key; if we're at the EOF,
               // `next()` will return false
               if (!reader.next()) {
@@ -530,8 +529,7 @@ public class HoodieNativeAvroHFileReader extends HoodieAvroHFileReaderImplBase {
         // do not call seekTo. Continue with reading the keys with the prefix.
       } else {
         // For the first key prefix, directly do seekTo.
-        int val = reader.seekTo(lookUpKeyPrefix);
-        if (val >= 1) {
+        if (reader.seekTo(lookUpKeyPrefix) >= HFileReader.SEEK_TO_IN_RANGE) {
           // Try moving to next entry, matching the prefix key; if we're at the EOF,
           // `next()` will return false
           if (!reader.next()) {
diff --git a/hudi-hadoop-common/src/test/java/org/apache/hudi/io/hadoop/TestHoodieHFileReaderWriterBase.java b/hudi-hadoop-common/src/test/java/org/apache/hudi/io/hadoop/TestHoodieHFileReaderWriterBase.java
index 3ed3343e93c..9fce54b82fe 100644
--- a/hudi-hadoop-common/src/test/java/org/apache/hudi/io/hadoop/TestHoodieHFileReaderWriterBase.java
+++ b/hudi-hadoop-common/src/test/java/org/apache/hudi/io/hadoop/TestHoodieHFileReaderWriterBase.java
@@ -268,11 +268,10 @@ public abstract class TestHoodieHFileReaderWriterBase extends TestHoodieReaderWr
   @Test
   public void testReaderGetRecordIteratorByKeys() throws Exception {
     writeFileWithSimpleSchema();
+    Schema avroSchema =
+        getSchemaFromResource(TestHoodieReaderWriterBase.class, "/exampleSchema.avsc");
     try (HoodieAvroHFileReaderImplBase hfileReader = (HoodieAvroHFileReaderImplBase)
         createReader(HoodieTestUtils.getStorage(getFilePath()))) {
-      Schema avroSchema =
-          getSchemaFromResource(TestHoodieReaderWriterBase.class, "/exampleSchema.avsc");
-
       List<String> keys = Collections.singletonList("key");
       Iterator<IndexedRecord> iterator =
           hfileReader.getIndexedRecordsByKeysIterator(keys, avroSchema);
@@ -307,16 +306,32 @@ public abstract class TestHoodieHFileReaderWriterBase extends TestHoodieReaderWr
               .collect(Collectors.toList());
       assertEquals(expectedKey1s, recordsByKeys);
     }
+    try (HoodieAvroHFileReaderImplBase hfileReader = getHFileReaderFromFixture()) {
+      List<GenericRecord> allRecords = toStream(hfileReader.getRecordIterator())
+          .map(r -> (GenericRecord) r.getData()).collect(Collectors.toList());
+      Iterator<IndexedRecord> iterator = hfileReader.getIndexedRecordsByKeysIterator(
+          Arrays.asList("key000000", "key000066-abcdefghij", "key001424-aa", "key001424-aaa",
+              "key004958-abcdefghij", "key010769", "key019889-abcdefghij", "key030000"),
+          avroSchema);
+      List<GenericRecord> actual =
+          StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false)
+              .map(r -> (GenericRecord) r)
+              .collect(Collectors.toList());
+      List<GenericRecord> expected = allRecords.stream().filter(entry -> (
+          (entry.get("_row_key").toString()).equals("key000066-abcdefghij")
+              || (entry.get("_row_key").toString()).equals("key004958-abcdefghij")
+              || (entry.get("_row_key").toString()).equals("key019889-abcdefghij"))).collect(Collectors.toList());
+      assertEquals(expected, actual);
+    }
   }
 
   @Test
   public void testReaderGetRecordIteratorByKeyPrefixes() throws Exception {
     writeFileWithSimpleSchema();
+    Schema avroSchema =
+        getSchemaFromResource(TestHoodieReaderWriterBase.class, "/exampleSchema.avsc");
     try (HoodieAvroHFileReaderImplBase hfileReader = (HoodieAvroHFileReaderImplBase)
         createReader(HoodieTestUtils.getStorage(getFilePath()))) {
-      Schema avroSchema =
-          getSchemaFromResource(TestHoodieReaderWriterBase.class, "/exampleSchema.avsc");
-
       List<String> keyPrefixes = Collections.singletonList("key");
       Iterator<IndexedRecord> iterator =
           hfileReader.getIndexedRecordsByKeyPrefixIterator(keyPrefixes, avroSchema);
@@ -432,6 +447,25 @@ public abstract class TestHoodieHFileReaderWriterBase extends TestHoodieReaderWr
       });
       assertEquals(expectedKey1s, recordsByPrefix);
     }
+    try (HoodieAvroHFileReaderImplBase hfileReader = getHFileReaderFromFixture()) {
+      List<GenericRecord> allRecords = toStream(hfileReader.getRecordIterator())
+          .map(r -> (GenericRecord) r.getData()).collect(Collectors.toList());
+      Iterator<IndexedRecord> iterator = hfileReader.getIndexedRecordsByKeyPrefixIterator(
+          Arrays.asList("key000000", "key000066-abcdefghij", "key001424-aa", "key001424-aaa",
+              "key004958", "key010769", "key01988", "key030000"),
+          avroSchema);
+      List<GenericRecord> actual =
+          StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false)
+              .map(r -> (GenericRecord) r)
+              .collect(Collectors.toList());
+      List<GenericRecord> expected = allRecords.stream().filter(entry -> (
+          (entry.get("_row_key").toString()).contains("key000000")
+              || (entry.get("_row_key").toString()).contains("key000066-abcdefghij")
+              || (entry.get("_row_key").toString()).contains("key004958")
+              || (entry.get("_row_key").toString()).contains("key010769")
+              || (entry.get("_row_key").toString()).contains("key01988"))).collect(Collectors.toList());
+      assertEquals(expected, actual);
+    }
   }
 
   @ParameterizedTest
@@ -487,4 +521,17 @@ public abstract class TestHoodieHFileReaderWriterBase extends TestHoodieReaderWr
     }
     return rowKeys;
   }
+
+  private HoodieAvroHFileReaderImplBase getHFileReaderFromFixture() throws IOException {
+    // This HFile has the following key and value
+    // key: key000000-abcdefghij to key019999-abcdefghij
+    // value: avro record based on exampleSchema.avsc
+    // The block index of interests:
+    // First: "Key{key000000-abcdefghij}" -> "BlockIndexEntry{firstKey=Key{key000000-abcdefghij}, offset=0, size=22
+    // "Key{key001424}" -> "BlockIndexEntry{firstKey=Key{key001424}, offset=13022, size=2157}"
+    // "Key{key010769}" -> "BlockIndexEntry{firstKey=Key{key010769}, offset=98878, size=2112}"
+    // Last: "Key{key019889}" -> "BlockIndexEntry{firstKey=Key{key019889}, offset=183324, size=1103}"
+    return createHFileReader(HoodieTestUtils.getStorage(getFilePath()),
+        readHFileFromResources("/hfile/hudi_1_0_hbase_2_4_13_avro_simple_schema_fake_first_key.hfile"));
+  }
 }
diff --git a/hudi-hadoop-common/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_avro_simple_schema_fake_first_key.hfile b/hudi-hadoop-common/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_avro_simple_schema_fake_first_key.hfile
new file mode 100644
index 00000000000..eb84e422e7f
Binary files /dev/null and b/hudi-hadoop-common/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_avro_simple_schema_fake_first_key.hfile differ
diff --git a/hudi-io/src/main/java/org/apache/hudi/io/hfile/BlockIndexEntry.java b/hudi-io/src/main/java/org/apache/hudi/io/hfile/BlockIndexEntry.java
index 635b2fad6f5..7c73b0222ff 100644
--- a/hudi-io/src/main/java/org/apache/hudi/io/hfile/BlockIndexEntry.java
+++ b/hudi-io/src/main/java/org/apache/hudi/io/hfile/BlockIndexEntry.java
@@ -31,6 +31,11 @@ import org.apache.hudi.common.util.Option;
  * are compared in lexicographical order.
  */
 public class BlockIndexEntry implements Comparable<BlockIndexEntry> {
+  // The first key stored in the block index can be shortened to save memory,
+  // i.e., a fake first key is stored in the block index entry, and such a fake
+  // first key does not exist in the data block. The fake first key is
+  // lexicographically greater than the last key of the previous block and
+  // lexicographically equal or smaller than the actual first key of the current block.
   private final Key firstKey;
   private final Option<Key> nextBlockFirstKey;
   private final long offset;
diff --git a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileDataBlock.java b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileDataBlock.java
index 8722d7cbeb4..b7b152d4773 100644
--- a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileDataBlock.java
+++ b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileDataBlock.java
@@ -21,6 +21,7 @@ package org.apache.hudi.io.hfile;
 
 import org.apache.hudi.common.util.Option;
 
+import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_BEFORE_BLOCK_FIRST_KEY;
 import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_FOUND;
 import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_IN_RANGE;
 import static org.apache.hudi.io.hfile.KeyValue.KEY_OFFSET;
@@ -55,9 +56,19 @@ public class HFileDataBlock extends HFileBlock {
    * @param key                    key to look up.
    * @param blockStartOffsetInFile the start offset of the block relative to the beginning of the
    *                               HFile.
-   * @return 0 if the block contains the exact same key as the lookup key, and the cursor points
-   * to the key; or 1 if the lookup key does not exist, and the cursor points to the
-   * lexicographically largest key that is smaller than the lookup key.
+   * @return 0 ({@link HFileReader#SEEK_TO_FOUND}) if the block contains the exact same key as
+   * the lookup key; the cursor points to the key;
+   * 1 ({@link HFileReader#SEEK_TO_IN_RANGE}) if the lookup key does not exist, and the lookup
+   * key is lexicographically greater than the actual first key of the data block and
+   * lexicographically smaller than the start key of the next data block based on the block index,
+   * or lexicographically smaller than or equal to the last key of the file if the data block is
+   * the last one; the cursor points to the lexicographically largest key that is smaller
+   * than the lookup key;
+   * -2 (@link HFileReader#SEEK_TO_BEFORE_BLOCK_FIRST_KEY) if the lookup key does not exist,
+   * and the lookup key is lexicographically greater than or equal to the fake first key of the
+   * data block based on the block index and lexicographically smaller than the actual first key
+   * of the data block; the cursor points to the actual first key of the data block which is
+   * lexicographically greater than the lookup key.
    */
   public int seekTo(HFileCursor cursor, Key key, int blockStartOffsetInFile) {
     int relativeOffset = cursor.getOffset() - blockStartOffsetInFile;
@@ -84,7 +95,10 @@ public class HFileDataBlock extends HFileBlock {
           // Otherwise, defer the read till it's needed
           cursor.setOffset(lastRelativeOffset + blockStartOffsetInFile);
         }
-        return SEEK_TO_IN_RANGE;
+        // If the lookup key is lexicographically smaller than the first key pointed to by
+        // the cursor, SEEK_TO_BEFORE_BLOCK_FIRST_KEY should be returned, so the caller
+        // know that the cursor is ahead of the lookup key in this case.
+        return isAtFirstKey(relativeOffset) ? SEEK_TO_BEFORE_BLOCK_FIRST_KEY : SEEK_TO_IN_RANGE;
       }
       long increment =
           (long) KEY_OFFSET + (long) kv.getKeyLength() + (long) kv.getValueLength()
@@ -131,4 +145,8 @@ public class HFileDataBlock extends HFileBlock {
         + (long) keyValue.get().getValueLength() + ZERO_TS_VERSION_BYTE_LENGTH);
     return cursor.getOffset() - blockStartOffsetInFile < uncompressedContentEndRelativeOffset;
   }
+
+  private boolean isAtFirstKey(int relativeOffset) {
+    return relativeOffset == HFILEBLOCK_HEADER_SIZE;
+  }
 }
diff --git a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReader.java b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReader.java
index fcc3be55866..7b8dbceacfc 100644
--- a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReader.java
+++ b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReader.java
@@ -30,14 +30,33 @@ import java.nio.ByteBuffer;
  */
 public interface HFileReader extends Closeable {
   // Return code of seekTo(Key)
-  // When the lookup key is less than the first key of the file
+  // When the lookup key is not found, but it's lexicographically greater than
+  // or equal to the fake first key of the data block based on the block index and
+  // lexicographically smaller than the actual first key of the data block
+  // The cursor points to the actual first key of the data block which is
+  // lexicographically greater than the lookup key
+  // PLEASE NOTE that there is an optimization of block index (enabled by default)
+  // that the first key can be shortened to save memory, i.e., a fake first key is
+  // stored in the block index entry, and such a fake first key does not exist in
+  // the data block. The fake first key is lexicographically greater than the last
+  // key of the previous block and lexicographically equal or smaller than the
+  // actual first key of the current block.
+  // PLEASE ALSO NOTE that the first key of the first data block stored in the block
+  // index is not shortened and always exists in the first data block.
+  int SEEK_TO_BEFORE_BLOCK_FIRST_KEY = -2;
+  // When the lookup key is lexicographically smaller than the first key of the file
   // The cursor points to the first key of the file
-  int SEEK_TO_BEFORE_FIRST_KEY = -1;
+  int SEEK_TO_BEFORE_FILE_FIRST_KEY = -1;
   // When the lookup key is found in the file
   // The cursor points to the matched key in the file
   int SEEK_TO_FOUND = 0;
-  // When the lookup key is not found, but it's in the range of the file
-  // The cursor points to the greatest key that is less than the lookup key
+  // When the lookup key is not found, but it's in the range of the file,
+  // and specifically the lookup key is lexicographically greater than the
+  // actual first key of the data block and lexicographically smaller than
+  // the start key of the next data block based on the block index,
+  // or lexicographically smaller than or equal to the last key of the file
+  // if the data block is the last one
+  // The cursor points to the greatest key that is lexicographically smaller than the lookup key
   int SEEK_TO_IN_RANGE = 1;
   // When the lookup key is greater than the last key of the file, EOF is reached
   // The cursor points to EOF
@@ -83,14 +102,19 @@ public interface HFileReader extends Closeable {
    * <p>
    *
    * @param key {@link Key} to seek to.
-   * @return -1, if key &lt; kv[0], no position;
-   * 0, such that kv[i].key = key and the reader is left in position i; and
-   * 1, such that kv[i].key &lt; key if there is no exact match, and the reader is left in
-   * position i.
-   * The reader will position itself between kv[i] and kv[i+1] where
-   * kv[i].key &lt; key &lt;= kv[i+1].key;
-   * 2, if there is no KV greater than or equal to the input key, and the reader positions
-   * itself at the end of the file and next() will return {@code false} when it is called.
+   * @return -2 ({@link HFileReader#SEEK_TO_BEFORE_BLOCK_FIRST_KEY}), such that
+   * block_fake_first_key &lt;= key &lt; block_actual_first_key if there is no
+   * exact match, and the reader is left in position at block_actual_first_key;
+   * -1 ({@link HFileReader#SEEK_TO_BEFORE_FILE_FIRST_KEY}), if key &lt; kv[0], the reader
+   * is left in position 0;
+   * 0 ({@link HFileReader#SEEK_TO_FOUND}), such that kv[i].key = key and the reader is
+   * left in position i;
+   * 1 ({@link HFileReader#SEEK_TO_IN_RANGE}), such that kv[i].key &lt; key if there is
+   * no exact match and the key is greater than the actual first of the data block, and
+   * the reader is left in position i;
+   * 2 ({@link HFileReader#SEEK_TO_EOF}), if there is no KV greater than or equal to the
+   * input key, and the reader positions itself at the end of the file and next() will
+   * return {@code false} when it is called.
    * @throws IOException upon read errors.
    */
   int seekTo(Key key) throws IOException;
diff --git a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReaderImpl.java b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReaderImpl.java
index 564dd98eb64..b376ce766ae 100644
--- a/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReaderImpl.java
+++ b/hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileReaderImpl.java
@@ -168,14 +168,28 @@ public class HFileReaderImpl implements HFileReader {
     if (compareCurrent == 0) {
       return SEEK_TO_FOUND;
     }
-    if (!isAtFirstKey()) {
-      // For backward seekTo after the first key, throw exception
-      throw new IllegalStateException(
-          "The current lookup key is less than the current position of the cursor, "
-              + "i.e., backward seekTo, which is not supported and should be avoided. "
-              + "key=" + key + " cursor=" + cursor);
+    // compareCurrent < 0, i.e., the lookup key is lexicographically smaller than
+    // the key at the current cursor
+    // We need to check two cases that are allowed:
+    // 1. The lookup key is lexicographically greater than or equal to the fake first key
+    // of the data block based on the block index and lexicographically smaller than
+    // the actual first key of the data block
+    // See HFileReader#SEEK_TO_BEFORE_BLOCK_FIRST_KEY for more information
+    if (isAtFirstKeyOfBlock(currentDataBlockEntry.get())
+        && key.compareTo(currentDataBlockEntry.get().getFirstKey()) >= 0) {
+      return SEEK_TO_BEFORE_BLOCK_FIRST_KEY;
     }
-    return SEEK_TO_BEFORE_FIRST_KEY;
+    // 2. The lookup key is lexicographically smaller than the first key of the file
+    if (!dataBlockIndexEntryMap.isEmpty()
+        && isAtFirstKeyOfBlock(dataBlockIndexEntryMap.firstEntry().getValue())) {
+      // the lookup key is lexicographically smaller than the first key of the file
+      return SEEK_TO_BEFORE_FILE_FIRST_KEY;
+    }
+    // For invalid backward seekTo, throw exception
+    throw new IllegalStateException(
+        "The current lookup key is less than the current position of the cursor, "
+            + "i.e., backward seekTo, which is not supported and should be avoided. "
+            + "key=" + key + " cursor=" + cursor);
   }
 
   @Override
@@ -293,9 +307,9 @@ public class HFileReaderImpl implements HFileReader {
     return (HFileDataBlock) blockReader.nextBlock(HFileBlockType.DATA);
   }
 
-  private boolean isAtFirstKey() {
-    if (cursor.isValid() && !dataBlockIndexEntryMap.isEmpty()) {
-      return cursor.getOffset() == dataBlockIndexEntryMap.firstKey().getOffset() + HFILEBLOCK_HEADER_SIZE;
+  private boolean isAtFirstKeyOfBlock(BlockIndexEntry indexEntry) {
+    if (cursor.isValid()) {
+      return cursor.getOffset() == indexEntry.getOffset() + HFILEBLOCK_HEADER_SIZE;
     }
     return false;
   }
diff --git a/hudi-io/src/test/java/org/apache/hudi/io/hfile/TestHFileReader.java b/hudi-io/src/test/java/org/apache/hudi/io/hfile/TestHFileReader.java
index ef7d1c3fc75..28f02c10d71 100644
--- a/hudi-io/src/test/java/org/apache/hudi/io/hfile/TestHFileReader.java
+++ b/hudi-io/src/test/java/org/apache/hudi/io/hfile/TestHFileReader.java
@@ -38,7 +38,8 @@ import java.util.function.Function;
 import java.util.stream.Stream;
 
 import static org.apache.hudi.common.util.FileIOUtils.readAsByteArray;
-import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_BEFORE_FIRST_KEY;
+import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_BEFORE_BLOCK_FIRST_KEY;
+import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_BEFORE_FILE_FIRST_KEY;
 import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_EOF;
 import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_FOUND;
 import static org.apache.hudi.io.hfile.HFileReader.SEEK_TO_IN_RANGE;
@@ -62,31 +63,39 @@ public class TestHFileReader {
   public static final String DUMMY_BLOOM_FILTER =
       "/////wAAABQBAAABID797Rg6cC9QEnS/mT3C01cdQGaLYH2jbOCLtMA0RWppEH1HQg==";
   public static final Function<Integer, String> KEY_CREATOR = i -> String.format("hudi-key-%09d", i);
+  public static final Function<Integer, String> KEY_CREATOR_WITH_SUFFIX = i -> String.format("hudi-key-%09d-abcdefghij", i);
   public static final Function<Integer, String> VALUE_CREATOR = i -> String.format("hudi-value-%09d", i);
-  private static final int SEEK_TO_THROW_EXCEPTION = -2;
+  private static final int SEEK_TO_THROW_EXCEPTION = -3;
 
   static Stream<Arguments> testArgsReadHFilePointAndPrefixLookup() {
     return Stream.of(
         Arguments.of(
             "/hfile/hudi_1_0_hbase_2_4_9_16KB_GZ_20000.hfile",
             20000,
+            KEY_CREATOR,
             Arrays.asList(
                 // before first key
-                new KeyLookUpInfo("", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("a", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
+                new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("as", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                // backward seekTo before first key is allowed and safe
+                new KeyLookUpInfo("aa", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
                 // first key
                 new KeyLookUpInfo("hudi-key-000000000", SEEK_TO_FOUND, "hudi-key-000000000", "hudi-value-000000000"),
                 // key in the block 0
-                new KeyLookUpInfo("hudi-key-000000100", SEEK_TO_FOUND, "hudi-key-000000100", "hudi-value-000000100"),
-                // backward seek not supported
-                new KeyLookUpInfo("hudi-key-000000099", SEEK_TO_THROW_EXCEPTION, "", ""),
+                new KeyLookUpInfo("hudi-key-000000099", SEEK_TO_FOUND, "hudi-key-000000099", "hudi-value-000000099"),
+                // backward seek not supported in a block
+                new KeyLookUpInfo("hudi-key-000000098", SEEK_TO_THROW_EXCEPTION, "", ""),
                 // prefix lookup, the pointer should not move
+                new KeyLookUpInfo("hudi-key-00000010", SEEK_TO_IN_RANGE, "hudi-key-000000099", "hudi-value-000000099"),
+                // non-exact lookup, the pointer should move
                 new KeyLookUpInfo("hudi-key-000000100a", SEEK_TO_IN_RANGE, "hudi-key-000000100",
                     "hudi-value-000000100"),
                 new KeyLookUpInfo("hudi-key-000000100b", SEEK_TO_IN_RANGE, "hudi-key-000000100",
                     "hudi-value-000000100"),
                 // prefix lookup with a jump, the pointer should not go beyond the lookup key
+                new KeyLookUpInfo("hudi-key-00000020", SEEK_TO_IN_RANGE, "hudi-key-000000199",
+                    "hudi-value-000000199"),
                 new KeyLookUpInfo("hudi-key-000000200a", SEEK_TO_IN_RANGE, "hudi-key-000000200",
                     "hudi-value-000000200"),
                 new KeyLookUpInfo("hudi-key-000000200b", SEEK_TO_IN_RANGE, "hudi-key-000000200",
@@ -130,14 +139,124 @@ public class TestHFileReader {
                 new KeyLookUpInfo("hudi-key-000019999b", SEEK_TO_EOF, "", "")
             )
         ),
+        // This HFile has fake first keys, i.e., a key that does not exist in the data block,
+        // stored in the entries in the Meta Index Block
+        Arguments.of(
+            "/hfile/hudi_1_0_hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile",
+            20000,
+            KEY_CREATOR_WITH_SUFFIX,
+            Arrays.asList(
+                // before first key
+                new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY,
+                    "hudi-key-000000000-abcdefghij", "hudi-value-000000000"),
+                new KeyLookUpInfo("as", SEEK_TO_BEFORE_FILE_FIRST_KEY,
+                    "hudi-key-000000000-abcdefghij", "hudi-value-000000000"),
+                // backward seekTo before first key is allowed and safe
+                new KeyLookUpInfo("aa", SEEK_TO_BEFORE_FILE_FIRST_KEY,
+                    "hudi-key-000000000-abcdefghij", "hudi-value-000000000"),
+                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY,
+                    "hudi-key-000000000-abcdefghij", "hudi-value-000000000"),
+                // first key
+                new KeyLookUpInfo("hudi-key-000000000-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000000000-abcdefghij", "hudi-value-000000000"),
+                // key in the block 0
+                new KeyLookUpInfo("hudi-key-000000099-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000000099-abcdefghij", "hudi-value-000000099"),
+                // backward seek not supported in a block
+                new KeyLookUpInfo("hudi-key-000000098", SEEK_TO_THROW_EXCEPTION, "", ""),
+                // prefix lookup, the pointer should not move
+                new KeyLookUpInfo("hudi-key-00000010", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000099-abcdefghij", "hudi-value-000000099"),
+                // non-exact lookup, the pointer should move
+                new KeyLookUpInfo("hudi-key-000000100a", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000100-abcdefghij", "hudi-value-000000100"),
+                new KeyLookUpInfo("hudi-key-000000100b", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000100-abcdefghij", "hudi-value-000000100"),
+                // prefix lookup with a jump, the pointer should not go beyond the lookup key
+                new KeyLookUpInfo("hudi-key-00000030", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000299-abcdefghij", "hudi-value-000000299"),
+                new KeyLookUpInfo("hudi-key-000000300", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000299-abcdefghij", "hudi-value-000000299"),
+                new KeyLookUpInfo("hudi-key-000000300a", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000300-abcdefghij", "hudi-value-000000300"),
+                // last key of the block 1
+                new KeyLookUpInfo("hudi-key-000000469-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000000469-abcdefghij", "hudi-value-000000469"),
+                new KeyLookUpInfo("hudi-key-000000469a", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000469-abcdefghij", "hudi-value-000000469"),
+                new KeyLookUpInfo("hudi-key-000000469b", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000469-abcdefghij", "hudi-value-000000469"),
+                // Block 2:
+                // fake first key in block index: hudi-key-00000047
+                // actual first key: hudi-key-000000470-abcdefghij
+                // Lookup key is smaller than actual first key
+                new KeyLookUpInfo("hudi-key-00000047", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000000470-abcdefghij", "hudi-value-000000470"),
+                new KeyLookUpInfo("hudi-key-000000470", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000000470-abcdefghij", "hudi-value-000000470"),
+                // Lookup key is greater than actual first key
+                new KeyLookUpInfo("hudi-key-000000473", SEEK_TO_IN_RANGE,
+                    "hudi-key-000000472-abcdefghij", "hudi-value-000000472"),
+                // Block 29:
+                // fake first key in block index: hudi-key-000006815
+                // actual first key: hudi-key-000006815-abcdefghij
+                new KeyLookUpInfo("hudi-key-000006815-aaa", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006815-aaa", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                // Backward seekTo within the range [fake first key, actual first key) is OK
+                new KeyLookUpInfo("hudi-key-000006815-aa", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006815", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                // Backward seekTo before the fake first key is not supported
+                new KeyLookUpInfo("hudi-key-000006814", SEEK_TO_THROW_EXCEPTION, "", ""),
+                new KeyLookUpInfo("hudi-key-000006815-ab", SEEK_TO_BEFORE_BLOCK_FIRST_KEY,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006815-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006815-ac", SEEK_TO_IN_RANGE,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006816", SEEK_TO_IN_RANGE,
+                    "hudi-key-000006815-abcdefghij", "hudi-value-000006815"),
+                new KeyLookUpInfo("hudi-key-000006816-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000006816-abcdefghij", "hudi-value-000006816"),
+                // adjacent keys
+                new KeyLookUpInfo("hudi-key-000013900-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000013900-abcdefghij", "hudi-value-000013900"),
+                new KeyLookUpInfo("hudi-key-000013901-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000013901-abcdefghij", "hudi-value-000013901"),
+                new KeyLookUpInfo("hudi-key-000013902-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000013902-abcdefghij", "hudi-value-000013902"),
+                new KeyLookUpInfo("hudi-key-000019500-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000019500-abcdefghij", "hudi-value-000019500"),
+                // prefix lookups
+                new KeyLookUpInfo("hudi-key-0000196", SEEK_TO_IN_RANGE, "hudi-key-000019599-abcdefghij", "hudi-value-000019599"),
+                new KeyLookUpInfo("hudi-key-00001960", SEEK_TO_IN_RANGE, "hudi-key-000019599-abcdefghij", "hudi-value-000019599"),
+                new KeyLookUpInfo("hudi-key-000019600a", SEEK_TO_IN_RANGE, "hudi-key-000019600-abcdefghij",
+                    "hudi-value-000019600"),
+                // second to last key
+                new KeyLookUpInfo("hudi-key-000019998-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000019998-abcdefghij", "hudi-value-000019998"),
+                // last key
+                new KeyLookUpInfo("hudi-key-000019999-abcdefghij", SEEK_TO_FOUND,
+                    "hudi-key-000019999-abcdefghij", "hudi-value-000019999"),
+                // after last key
+                new KeyLookUpInfo("hudi-key-000019999a", SEEK_TO_EOF, "", ""),
+                new KeyLookUpInfo("hudi-key-000019999b", SEEK_TO_EOF, "", "")
+            )
+        ),
         Arguments.of(
             "/hfile/hudi_1_0_hbase_2_4_9_512KB_GZ_20000.hfile",
             20000,
+            KEY_CREATOR,
             Arrays.asList(
                 // before first key
-                new KeyLookUpInfo("", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("a", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
+                new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("as", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                // backward seekTo before first key is allowed and safe
+                new KeyLookUpInfo("aa", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
                 // first key
                 new KeyLookUpInfo("hudi-key-000000000", SEEK_TO_FOUND, "hudi-key-000000000", "hudi-value-000000000"),
                 // last key of block 0
@@ -166,23 +285,30 @@ public class TestHFileReader {
         Arguments.of(
             "/hfile/hudi_1_0_hbase_2_4_9_16KB_NONE_5000.hfile",
             5000,
+            KEY_CREATOR,
             Arrays.asList(
                 // before first key
-                new KeyLookUpInfo("", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("a", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
+                new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("as", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                // backward seekTo before first key is allowed and safe
+                new KeyLookUpInfo("aa", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
                 // first key
                 new KeyLookUpInfo("hudi-key-000000000", SEEK_TO_FOUND, "hudi-key-000000000", "hudi-value-000000000"),
                 // key in the block 0
-                new KeyLookUpInfo("hudi-key-000000100", SEEK_TO_FOUND, "hudi-key-000000100", "hudi-value-000000100"),
-                // backward seek not supported
-                new KeyLookUpInfo("hudi-key-000000099", SEEK_TO_THROW_EXCEPTION, "", ""),
+                new KeyLookUpInfo("hudi-key-000000099", SEEK_TO_FOUND, "hudi-key-000000099", "hudi-value-000000099"),
+                // backward seek not supported in a block
+                new KeyLookUpInfo("hudi-key-000000098", SEEK_TO_THROW_EXCEPTION, "", ""),
                 // prefix lookup, the pointer should not move
+                new KeyLookUpInfo("hudi-key-00000010", SEEK_TO_IN_RANGE, "hudi-key-000000099", "hudi-value-000000099"),
+                // non-exact lookup, the pointer should move
                 new KeyLookUpInfo("hudi-key-000000100a", SEEK_TO_IN_RANGE, "hudi-key-000000100",
                     "hudi-value-000000100"),
                 new KeyLookUpInfo("hudi-key-000000100b", SEEK_TO_IN_RANGE, "hudi-key-000000100",
                     "hudi-value-000000100"),
                 // prefix lookup with a jump, the pointer should not go beyond the lookup key
+                new KeyLookUpInfo("hudi-key-00000020", SEEK_TO_IN_RANGE, "hudi-key-000000199",
+                    "hudi-value-000000199"),
                 new KeyLookUpInfo("hudi-key-000000200a", SEEK_TO_IN_RANGE, "hudi-key-000000200",
                     "hudi-value-000000200"),
                 new KeyLookUpInfo("hudi-key-000000200b", SEEK_TO_IN_RANGE, "hudi-key-000000200",
@@ -227,11 +353,15 @@ public class TestHFileReader {
         Arguments.of(
             "/hfile/hudi_1_0_hbase_2_4_9_64KB_NONE_5000.hfile",
             5000,
+            KEY_CREATOR,
             Arrays.asList(
                 // before first key
-                new KeyLookUpInfo("", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("a", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
+                // before first key
+                new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("as", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                // backward seekTo before first key is allowed and safe
+                new KeyLookUpInfo("aa", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+                new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
                 // first key
                 new KeyLookUpInfo("hudi-key-000000000", SEEK_TO_FOUND, "hudi-key-000000000", "hudi-value-000000000"),
                 // last key of block 0
@@ -264,8 +394,9 @@ public class TestHFileReader {
   @MethodSource("testArgsReadHFilePointAndPrefixLookup")
   public void testReadHFilePointAndPrefixLookup(String filename,
                                                 int numEntries,
+                                                Function<Integer, String> keyCreator,
                                                 List<KeyLookUpInfo> keyLookUpInfoList) throws IOException {
-    verifyHFileRead(filename, numEntries, KEY_CREATOR, VALUE_CREATOR, keyLookUpInfoList);
+    verifyHFileRead(filename, numEntries, keyCreator, VALUE_CREATOR, keyLookUpInfoList);
   }
 
   @Test
@@ -334,9 +465,9 @@ public class TestHFileReader {
           // point and prefix lookups
           Arrays.asList(
               // before first key
-              new KeyLookUpInfo("", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-              new KeyLookUpInfo("a", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
-              new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FIRST_KEY, "", ""),
+              new KeyLookUpInfo("", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+              new KeyLookUpInfo("a", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
+              new KeyLookUpInfo("hudi-key-0000000", SEEK_TO_BEFORE_FILE_FIRST_KEY, "hudi-key-000000000", "hudi-value-000000000"),
               // first key
               new KeyLookUpInfo("hudi-key-000000000", SEEK_TO_FOUND, "hudi-key-000000000", "hudi-value-000000000"),
               // key in the block 0
@@ -402,7 +533,14 @@ public class TestHFileReader {
       assertFalse(reader.next());
       assertFalse(reader.seekTo());
       assertFalse(reader.next());
-      assertEquals(2, reader.seekTo(new UTF8StringKey("random")));
+      assertEquals(SEEK_TO_EOF, reader.seekTo(new UTF8StringKey("random")));
+      assertFalse(reader.next());
+    }
+    try (HFileReader reader = getHFileReader("/hfile/hudi_1_0_hbase_2_4_9_no_entry.hfile")) {
+      reader.initializeMetadata();
+      assertFalse(reader.isSeeked());
+      assertFalse(reader.seekTo());
+      assertEquals(SEEK_TO_EOF, reader.seekTo(new UTF8StringKey("random")));
       assertFalse(reader.next());
     }
   }
@@ -550,8 +688,9 @@ public class TestHFileReader {
       }
       switch (expectedSeekToResult) {
         case SEEK_TO_THROW_EXCEPTION:
-        case SEEK_TO_BEFORE_FIRST_KEY:
           break;
+        case SEEK_TO_BEFORE_BLOCK_FIRST_KEY:
+        case SEEK_TO_BEFORE_FILE_FIRST_KEY:
         case SEEK_TO_FOUND:
         case SEEK_TO_IN_RANGE:
           assertTrue(reader.getKeyValue().isPresent());
diff --git a/hudi-io/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile b/hudi-io/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile
new file mode 100644
index 00000000000..48256377c08
Binary files /dev/null and b/hudi-io/src/test/resources/hfile/hudi_1_0_hbase_2_4_13_16KB_GZ_20000_fake_first_key.hfile differ


(hudi) 02/02: [MINOR] Remove spark2 bundle form validate staged bundles script (#13187)

Posted by vh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vhs pushed a commit to branch release-1.0.2
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit d1cdcb1c569886748aa6aa75c129658891899c8c
Author: voonhous <vo...@gmail.com>
AuthorDate: Mon Apr 21 14:30:12 2025 +0800

    [MINOR] Remove spark2 bundle form validate staged bundles script (#13187)
    
    (cherry picked from commit 22d3bde6257ca2f6201f1c1e103ed412a3ee8387)
---
 scripts/release/validate_staged_bundles.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/release/validate_staged_bundles.sh b/scripts/release/validate_staged_bundles.sh
index 953db059575..32c229f9eef 100755
--- a/scripts/release/validate_staged_bundles.sh
+++ b/scripts/release/validate_staged_bundles.sh
@@ -34,7 +34,7 @@ declare -a extensions=("-javadoc.jar" "-javadoc.jar.asc" "-javadoc.jar.md5" "-ja
 
 declare -a bundles=("hudi-aws-bundle" "hudi-cli-bundle_2.12" "hudi-cli-bundle_2.13" "hudi-datahub-sync-bundle" "hudi-flink1.14-bundle"
 "hudi-flink1.15-bundle" "hudi-flink1.16-bundle" "hudi-flink1.17-bundle" "hudi-flink1.18-bundle" "hudi-gcp-bundle" "hudi-hadoop-mr-bundle" "hudi-hive-sync-bundle" "hudi-integ-test-bundle"
-"hudi-kafka-connect-bundle" "hudi-metaserver-server-bundle" "hudi-presto-bundle" "hudi-spark-bundle_2.12"
+"hudi-kafka-connect-bundle" "hudi-metaserver-server-bundle" "hudi-presto-bundle"
 "hudi-spark3.3-bundle_2.12" "hudi-spark3.4-bundle_2.12" "hudi-spark3.5-bundle_2.12"
 "hudi-spark3.5-bundle_2.13" "hudi-timeline-server-bundle" "hudi-trino-bundle"
 "hudi-utilities-bundle_2.12" "hudi-utilities-bundle_2.13"