SteNicholas commented on code in PR #8024:
URL: https://github.com/apache/hudi/pull/8024#discussion_r1116542929
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/RollbackToInstantTimeProcedure.scala:
##########
@@ -73,10 +73,14 @@ class RollbackToInstantTimeProcedure extends BaseProcedure
with ProcedureBuilder
throw new HoodieException(s"Commit $instantTime not found in Commits
$completedTimeline")
}
- val result = if (client.rollback(instantTime)) true else false
- val outputRow = Row(result)
+ val outputRow = new util.ArrayList[Row]
+ val allInstants: List[HoodieInstant] = completedTimeline
+ .findInstantsAfterOrEquals(instantTime,
Integer.MAX_VALUE).getReverseOrderedInstants.toArray()
+ .map(r => r.asInstanceOf[HoodieInstant]).toList
- Seq(outputRow)
+ allInstants.foreach(p =>
outputRow.add(Row(client.rollback(p.getTimestamp), p.getTimestamp)))
Review Comment:
The request argument of `rollback_to_instant` has the `instant_time`,
therefore the return result doesn't need the `instant_time`.
--
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]