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


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestHoodieSparkSqlWriter.scala:
##########
@@ -873,7 +873,7 @@ def testBulkInsertForDropPartitionColumn(): Unit = {
     fooTableModifier = 
fooTableModifier.updated(DataSourceWriteOptions.OPERATION.key(), 
WriteOperationType.DELETE_PARTITION.name())
     HoodieSparkSqlWriter.write(sqlContext, SaveMode.Append, fooTableModifier, 
recordsToDelete)
     validateDataAndPartitionStats(recordsToDelete, isDeletePartition = true)
-    val snapshotDF3 = spark.read.format("hudi").load(tempBasePath)
+    val snapshotDF3 = spark.read.format("org.apache.hudi").load(tempBasePath)

Review Comment:
   Why this change?  `hudi` format should work in Spark datasource.



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestBucketIndexSupport.scala:
##########
@@ -350,8 +351,9 @@ class TestBucketIndexSupport extends 
HoodieSparkClientTestBase with PredicateHel
   def exprFilePathAnswerCheck(bucketIndexSupport: BucketIndexSupport, exprRaw: 
String, expectResult: Set[String],
                               allFileStatus: Set[String], fallback: Boolean): 
Unit = {
     val resolveExpr = HoodieCatalystExpressionUtils.resolveExpr(spark, 
exprRaw, structSchema)
-    val optimizerPlan = 
spark.sessionState.optimizer.execute(DummyExpressionHolder(Seq(resolveExpr)))
-    val optimizerExpr = 
optimizerPlan.asInstanceOf[DummyExpressionHolder].exprs.head
+    val dummyExpressionHolder = HoodieDummyExpressionHolder(Seq(resolveExpr), 
resolveExpr.references.toSeq)

Review Comment:
   To clarify, this is test specific and we have functional test coverage on 
bucket index support.



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestColumnStatsIndexWithSQL.scala:
##########
@@ -627,11 +627,11 @@ class TestColumnStatsIndexWithSQL extends 
ColumnStatIndexTestBase {
 
     var dataFilter: Expression = GreaterThan(attribute("c5"), literal("70"))
     verifyPruningFileCount(commonOpts, dataFilter)
-    dataFilter = And(dataFilter, GreaterThan(attribute("c6"), 
literal("'2020-03-28'")))
+    dataFilter = And(dataFilter, GreaterThan(attribute("c6"), 
literal("2020-03-28")))
     verifyPruningFileCount(commonOpts, dataFilter)
     dataFilter = GreaterThan(attribute("c5"), literal("90"))
     verifyPruningFileCount(commonOpts, dataFilter)
-    dataFilter = And(dataFilter, GreaterThan(attribute("c6"), 
literal("'2020-03-28'")))
+    dataFilter = And(dataFilter, GreaterThan(attribute("c6"), 
literal("2020-03-28")))

Review Comment:
   Is the original test written improperly?



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestColumnStatsIndexWithSQL.scala:
##########
@@ -641,17 +641,20 @@ class TestColumnStatsIndexWithSQL extends 
ColumnStatIndexTestBase {
     var fileIndex = HoodieFileIndex(spark, metaClient, None, commonOpts, 
includeLogFiles = true)
     val filteredPartitionDirectories = fileIndex.listFiles(Seq(), 
Seq(dataFilter))
     val filteredFilesCount = filteredPartitionDirectories.flatMap(s => 
s.files).size
+    val latestDataFilesCount = getLatestDataFilesCount(opts)
     if (shouldPrune) {
-      assertTrue(filteredFilesCount < getLatestDataFilesCount(opts))
+      assertTrue(filteredFilesCount < latestDataFilesCount,
+        "actual filteredFilesCount: " + filteredFilesCount + ", actual 
latestDataFilesCount: " + latestDataFilesCount)
     } else {
-      assertEquals(filteredFilesCount, getLatestDataFilesCount(opts))
+      assertEquals(filteredFilesCount, latestDataFilesCount)
     }
 
     // with no data skipping
     fileIndex = HoodieFileIndex(spark, metaClient, None, commonOpts + 
(DataSourceReadOptions.ENABLE_DATA_SKIPPING.key -> "false"), includeLogFiles = 
true)
     val filesCountWithNoSkipping = fileIndex.listFiles(Seq(), 
Seq(dataFilter)).flatMap(s => s.files).size
     if (shouldPrune) {
-      assertTrue(filteredFilesCount < filesCountWithNoSkipping)
+      assertTrue(filteredFilesCount < filesCountWithNoSkipping,
+      "actual filteredFilesCount: " + filteredFilesCount + ", actual 
filesCountWithNoSkipping: " + filesCountWithNoSkipping)

Review Comment:
   Let's avoid unnecessary changes in the future.



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestParquetColumnProjection.scala:
##########
@@ -71,7 +71,7 @@ class TestParquetColumnProjection extends 
SparkClientFunctionalTestHarness with
     // Stats for the reads fetching only _projected_ columns (note how amount 
of bytes read
     // increases along w/ the # of columns)
     val projectedColumnsReadStats: Array[(String, Long)] =
-      if (HoodieSparkUtils.isSpark3)
+      if (HoodieSparkUtils.gteqSpark3_3_2)

Review Comment:
   Why this change?



-- 
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