XuQianJin-Stars commented on code in PR #8024:
URL: https://github.com/apache/hudi/pull/8024#discussion_r1116834151
##########
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:
> why we need outputRow, how about return allInstants.map(p =>
Row(client.rollback(p.getTimestamp), p.getTimestamp)) directly
A bit hesitant to add `limit`
--
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]