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

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

commit f1fbc42a62e5a0604053cec1df8d1d98583a4743
Author: TheR1sing3un <[email protected]>
AuthorDate: Thu Nov 6 10:18:52 2025 +0800

    test: fix flaky test in TestSecondaryIndex (#14211)
    
    Signed-off-by: TheR1sing3un <[email protected]>
---
 .../org/apache/spark/sql/hudi/feature/index/TestSecondaryIndex.scala   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/feature/index/TestSecondaryIndex.scala
 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/feature/index/TestSecondaryIndex.scala
index 48231f6272a3..f38b45a42a02 100644
--- 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/feature/index/TestSecondaryIndex.scala
+++ 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/feature/index/TestSecondaryIndex.scala
@@ -22,6 +22,7 @@ package org.apache.spark.sql.hudi.feature.index
 import org.apache.hudi.{DataSourceReadOptions, DataSourceWriteOptions, 
HoodieSparkUtils}
 import org.apache.hudi.DataSourceWriteOptions._
 import org.apache.hudi.common.config.{HoodieMetadataConfig, RecordMergeMode}
+import org.apache.hudi.common.fs.FSUtils
 import org.apache.hudi.common.model.WriteOperationType
 import org.apache.hudi.common.table.{HoodieTableConfig, HoodieTableMetaClient, 
TableSchemaResolver}
 import org.apache.hudi.common.testutils.{HoodieTestDataGenerator, 
HoodieTestUtils}
@@ -581,7 +582,7 @@ class TestSecondaryIndex extends HoodieSparkSqlTestBase {
       // Perform Deletes on Records and Validate Secondary Index
       val deleteDf = 
spark.read.format("hudi").load(basePath).filter(s"_row_key in 
('${updateKeys.mkString("','")}')")
       // Get fileId for the delete record
-      val deleteFileId = 
deleteDf.select("_hoodie_file_name").collect().head.getString(0)
+      val deleteFileId = 
FSUtils.getFileId(deleteDf.select("_hoodie_file_name").collect().head.getString(0))
       deleteDf.write.format("hudi")
         .options(hudiOpts)
         .option(OPERATION.key, DELETE_OPERATION_OPT_VAL)

Reply via email to