xuzifu666 commented on code in PR #9988:
URL: https://github.com/apache/hudi/pull/9988#discussion_r1389518260


##########
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:
   I had remove some use less procedures and uts, ptal @danny0405 



##########
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:
   I had remove some use less procedures and uts, ptal @danny0405 



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