You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2023/07/02 05:29:44 UTC
[GitHub] [hudi] cxzl25 commented on a diff in pull request #8668: [HUDI-3639] Add Proper Incremental Records FIltering support into Hudi's custom RDD
cxzl25 commented on code in PR #8668:
URL: https://github.com/apache/hudi/pull/8668#discussion_r1249235832
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieMergeOnReadRDD.scala:
##########
@@ -116,7 +125,33 @@ class HoodieMergeOnReadRDD(@transient sc: SparkContext,
Option(TaskContext.get()).foreach(_.addTaskCompletionListener[Unit](_ => iter.asInstanceOf[Closeable].close()))
}
- iter
+ val commitTimeMetadataFieldIdx = requiredSchema.structTypeSchema.fieldNames.indexOf(HoodieRecord.COMMIT_TIME_METADATA_FIELD)
+ val needsFiltering = commitTimeMetadataFieldIdx >= 0 && !StringUtils.isNullOrEmpty(startTimestamp) && !StringUtils.isNullOrEmpty(endTimestamp)
+ if (needsFiltering) {
Review Comment:
I also tried to add a filter to the `buildScan` method of `HoodieBaseRelation` at the beginning, but there was a problem that the class was `not serializable`, so I moved to the `HoodieMergeOnReadRDD` class.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org