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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelation.scala:
##########
@@ -186,12 +184,12 @@ trait HoodieIncrementalRelationTrait extends 
HoodieBaseRelation {
 
   protected def endTimestamp: String = optParams.getOrElse(
     DataSourceReadOptions.END_INSTANTTIME.key,
-    if (hollowCommitHandling == USE_TRANSITION_TIME) 
super.timeline.lastInstant().get.getCompletionTime
-    else super.timeline.lastInstant().get.getTimestamp)
-
-  protected def startInstantArchived: Boolean = 
super.timeline.isBeforeTimelineStarts(startTimestamp)
+    super.timeline.getInstantsAsStream.iterator().asScala.toList
+      .map(_.getCompletionTime)

Review Comment:
   Can we add a utility method `getLatestCompletionTime` on the timeline.



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelation.scala:
##########
@@ -186,12 +184,12 @@ trait HoodieIncrementalRelationTrait extends 
HoodieBaseRelation {
 
   protected def endTimestamp: String = optParams.getOrElse(
     DataSourceReadOptions.END_INSTANTTIME.key,
-    if (hollowCommitHandling == USE_TRANSITION_TIME) 
super.timeline.lastInstant().get.getCompletionTime
-    else super.timeline.lastInstant().get.getTimestamp)
-
-  protected def startInstantArchived: Boolean = 
super.timeline.isBeforeTimelineStarts(startTimestamp)
+    super.timeline.getInstantsAsStream.iterator().asScala.toList
+      .map(_.getCompletionTime)

Review Comment:
   Can we add an utility method `getLatestCompletionTime` on the timeline.



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