danny0405 commented on code in PR #8668:
URL: https://github.com/apache/hudi/pull/8668#discussion_r1250377895


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestParquetColumnProjection.scala:
##########
@@ -330,6 +329,41 @@ class TestParquetColumnProjection extends 
SparkClientFunctionalTestHarness with
     assertTrue(commitNum > 1)
   }
 
+  @Test
+  def testMergeOnReadIncrementalRelationWithFilter(): Unit = {
+    val tablePath = s"$basePath/mor-with-logs-incr-filter"
+    val targetRecordsCount = 100
+
+    bootstrapMORTableWithDeltaLog(tablePath, targetRecordsCount, 
defaultWriteOpts, populateMetaFields = true, inlineCompact = true)
+
+    println(s"Running test for $tablePath / incremental")
+    val hoodieMetaClient = 
HoodieTableMetaClient.builder().setConf(spark.sparkContext.hadoopConfiguration).setBasePath(tablePath).setLoadActiveTimelineOnLoad(true).build()
+    val completedCommits = 
hoodieMetaClient.getCommitsAndCompactionTimeline.filterCompletedInstants()
+    val startUnarchivedCommitTs = 
(completedCommits.nthInstant(1).get().getTimestamp.toLong - 1L).toString
+    val endUnarchivedCommitTs = 
completedCommits.nthInstant(3).get().getTimestamp //commit
+
+    val readOpts = defaultWriteOpts ++ Map(
+      "path" -> tablePath,
+      DataSourceReadOptions.QUERY_TYPE.key -> 
DataSourceReadOptions.QUERY_TYPE_INCREMENTAL_OPT_VAL,
+      DataSourceReadOptions.BEGIN_INSTANTTIME.key -> startUnarchivedCommitTs,
+      DataSourceReadOptions.END_INSTANTTIME.key -> endUnarchivedCommitTs
+    )
+
+    val inputDf = spark.read.format("hudi")
+      .options(readOpts)
+      .load()
+    // Make sure the filter is not applied at the row group level
+    spark.sessionState.conf.setConfString("spark.sql.parquet.filterPushdown", 
"false")

Review Comment:
   Does this conflict with the setup within `HoodieBaseRelation` where 
`spark.sql.parquet.filterPushdown` is set up as true ?



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestParquetColumnProjection.scala:
##########
@@ -330,6 +329,41 @@ class TestParquetColumnProjection extends 
SparkClientFunctionalTestHarness with
     assertTrue(commitNum > 1)
   }
 
+  @Test
+  def testMergeOnReadIncrementalRelationWithFilter(): Unit = {
+    val tablePath = s"$basePath/mor-with-logs-incr-filter"
+    val targetRecordsCount = 100
+
+    bootstrapMORTableWithDeltaLog(tablePath, targetRecordsCount, 
defaultWriteOpts, populateMetaFields = true, inlineCompact = true)
+
+    println(s"Running test for $tablePath / incremental")
+    val hoodieMetaClient = 
HoodieTableMetaClient.builder().setConf(spark.sparkContext.hadoopConfiguration).setBasePath(tablePath).setLoadActiveTimelineOnLoad(true).build()

Review Comment:
   Should not print the msg in the tests



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelation.scala:
##########
@@ -56,7 +56,6 @@ case class MergeOnReadIncrementalRelation(override val 
sqlContext: SQLContext,
 
   override def imbueConfigs(sqlContext: SQLContext): Unit = {
     super.imbueConfigs(sqlContext)
-    
sqlContext.sparkSession.sessionState.conf.setConfString("spark.sql.parquet.enableVectorizedReader",
 "false")

Review Comment:
   No need to override this method now~



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadSnapshotRelation.scala:
##########
@@ -103,7 +103,6 @@ abstract class BaseMergeOnReadSnapshotRelation(sqlContext: 
SQLContext,
 
   override def imbueConfigs(sqlContext: SQLContext): Unit = {
     super.imbueConfigs(sqlContext)
-    
sqlContext.sparkSession.sessionState.conf.setConfString("spark.sql.parquet.enableVectorizedReader",
 "true")

Review Comment:
   No need to override this method now~



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