yihua commented on code in PR #18455:
URL: https://github.com/apache/hudi/pull/18455#discussion_r3082826967


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/others/TestMergeModeCommitTimeOrdering.scala:
##########
@@ -249,8 +255,11 @@ class TestMergeModeCommitTimeOrdering extends 
HoodieSparkSqlTestBase {
         // TODO(HUDI-8820): enable MDT after supporting MDT with table version 
6
         ("hoodie.metadata.enable" -> "false", tableVersion.toInt == 6)
       ) {
-        withRecordType()(withTempDir { tmp =>
+        withRecordType()({
           val tableName = generateTableName
+          val currTime = System.currentTimeMillis()
+          val tablePath = 
s"/home/ubuntu/ws3/hudi-rs/tables/table${TestMergeModeCommitTimeOrdering.cnt}_$currTime"
+          println(s"fdss: ${tablePath}")

Review Comment:
   🤖 nit: remove the debug string `"fdss: "` from this println, or replace with 
a meaningful test identifier if logging is needed.
   
   <sub><i>- Generated by an AI agent and may contain mistakes. Please verify 
any suggestions before applying.</i></sub>



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/others/TestMORFileSliceLayouts.scala:
##########
@@ -0,0 +1,823 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.spark.sql.hudi.dml.others
+
+import org.apache.hudi.HoodieCLIUtils
+import org.apache.hudi.common.model.{FileSlice, HoodieLogFile}
+import org.apache.hudi.common.model.HoodieRecord.HoodieRecordType
+import org.apache.hudi.common.table.{HoodieTableMetaClient, 
TableSchemaResolver}
+import org.apache.hudi.common.table.log.HoodieLogFileReader
+import 
org.apache.hudi.common.table.log.block.HoodieLogBlock.{HeaderMetadataType, 
HoodieLogBlockType}
+import org.apache.hudi.common.testutils.HoodieTestUtils
+import org.apache.hudi.common.util.{Option => HOption}
+import org.apache.hudi.testutils.DataSourceTestUtils
+
+import org.apache.hadoop.fs.Path
+import org.apache.spark.sql.SaveMode
+import org.apache.spark.sql.hudi.common.HoodieSparkSqlTestBase
+import 
org.apache.spark.sql.hudi.common.HoodieSparkSqlTestBase.getMetaClientAndFileSystemView
+
+import java.util.Collections
+
+import scala.collection.JavaConverters._
+
+/**
+ * Creates 4 MOR tables with specific file slice layouts, validates each layout
+ * via the same HoodieTableFileSystemView + getLatestMergedFileSlicesBeforeOrOn
+ * code path that SELECT uses, then saves gold data alongside each table.
+ */
+class TestMORFileSliceLayouts extends HoodieSparkSqlTestBase {
+
+  val BASE_OUTPUT_PATH = "/home/ubuntu/ws3/hudi-rs/tables/fdss"
+
+  private def cleanPath(path: String): Unit = {

Review Comment:
   🤖 nit: replace hardcoded `/home/ubuntu/...` path with a test-scoped temp 
directory (e.g., `spark.sessionState.conf.warehouseDir` or JUnit's `@TempDir`). 
This path is specific to your machine and will fail on CI/other developers' 
machines.
   
   <sub><i>- Generated by an AI agent and may contain mistakes. Please verify 
any suggestions before applying.</i></sub>



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/others/TestMergeModeCommitTimeOrdering.scala:
##########
@@ -28,13 +28,15 @@ import org.apache.hudi.common.testutils.HoodieTestUtils
 import org.apache.spark.sql.hudi.common.HoodieSparkSqlTestBase

Review Comment:
   🤖 nit: consider adding a comment to the `var cnt: Int` explaining its 
purpose (e.g., '// Counter to generate unique table paths for parallel test 
execution').
   
   <sub><i>- Generated by an AI agent and may contain mistakes. Please verify 
any suggestions before applying.</i></sub>



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/others/TestMergeModeCommitTimeOrdering.scala:
##########
@@ -249,8 +255,11 @@ class TestMergeModeCommitTimeOrdering extends 
HoodieSparkSqlTestBase {
         // TODO(HUDI-8820): enable MDT after supporting MDT with table version 
6
         ("hoodie.metadata.enable" -> "false", tableVersion.toInt == 6)
       ) {
-        withRecordType()(withTempDir { tmp =>
+        withRecordType()({
           val tableName = generateTableName
+          val currTime = System.currentTimeMillis()

Review Comment:
   🤖 nit: hardcoded `/home/ubuntu/...` path should be replaced with a test temp 
directory; this will fail on CI and other developers' machines.
   
   <sub><i>- Generated by an AI agent and may contain mistakes. Please verify 
any suggestions before applying.</i></sub>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to