From 8fe93c788b78c9239f8feb90d3d78a90b8153914 Mon Sep 17 00:00:00 2001 From: Lin Liu Date: Thu, 9 Jan 2025 18:10:53 -0800 Subject: [PATCH] Remove uncessary chagne --- .../apache/hudi/MergeOnReadIncrementalRelationV2.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelationV2.scala b/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelationV2.scala index c79f95ccda8bb..6222cd217f935 100644 --- a/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelationV2.scala +++ b/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelationV2.scala @@ -205,7 +205,15 @@ trait HoodieIncrementalRelationV2Trait extends HoodieBaseRelation { .analyze() protected lazy val includedCommits: immutable.Seq[HoodieInstant] = queryContext.getInstants.asScala.toList - protected lazy val commitsMetadata = includedCommits.map(getCommitMetadata(_, super.timeline)).asJava + + protected lazy val commitsMetadata = includedCommits.map( + i => { + if (queryContext.getArchivedInstants.contains(i)) { + getCommitMetadata(i, queryContext.getArchivedTimeline) + } else { + getCommitMetadata(i, queryContext.getActiveTimeline) + } + }).asJava protected lazy val affectedFilesInCommits: java.util.List[StoragePathInfo] = { listAffectedFilesForCommits(conf, metaClient.getBasePath, commitsMetadata)