xuzifu666 commented on code in PR #9988:
URL: https://github.com/apache/hudi/pull/9988#discussion_r1386071295
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ShowSavepointsProcedure.scala:
##########
@@ -54,7 +56,11 @@ class ShowSavepointsProcedure extends BaseProcedure with
ProcedureBuilder {
val commits: util.List[HoodieInstant] =
timeline.getReverseOrderedInstants.collect(Collectors.toList[HoodieInstant])
if (commits.isEmpty) Seq.empty[Row] else {
- commits.toArray.map(instant =>
instant.asInstanceOf[HoodieInstant].getTimestamp).map(p => Row(p)).toSeq
+ if (limit.isDefined) {
+
commits.stream().limit(limit.get.asInstanceOf[Int]).toArray.map(instant =>
instant.asInstanceOf[HoodieInstant].getTimestamp).map(p => Row(p)).toSeq
Review Comment:
try to construnct a 'limit and collect' method in parent class,but had 2
problem to face:
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ShowSavepointsProcedure.scala:
##########
@@ -54,7 +56,11 @@ class ShowSavepointsProcedure extends BaseProcedure with
ProcedureBuilder {
val commits: util.List[HoodieInstant] =
timeline.getReverseOrderedInstants.collect(Collectors.toList[HoodieInstant])
if (commits.isEmpty) Seq.empty[Row] else {
- commits.toArray.map(instant =>
instant.asInstanceOf[HoodieInstant].getTimestamp).map(p => Row(p)).toSeq
+ if (limit.isDefined) {
+
commits.stream().limit(limit.get.asInstanceOf[Int]).toArray.map(instant =>
instant.asInstanceOf[HoodieInstant].getTimestamp).map(p => Row(p)).toSeq
Review Comment:
try to construnct a 'limit and collect' method in parent class,but had 2
problem to face:
--
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]