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


##########
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:
   Because the dataframe(`inputDf`) is constructed first, `filterPushdown` is 
true, and then manually set to false.
   
   
https://github.com/apache/hudi/blob/b5f749ccbf14de0f2cdced0918719ccdc113f2d5/hudi-spark-datasource/hudi-spark3.2.x/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/Spark32HoodieParquetFileFormat.scala#L247-L251
   
   



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