danny0405 commented on code in PR #9988:
URL: https://github.com/apache/hudi/pull/9988#discussion_r1390316539
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ShowBootstrapPartitionsProcedure.scala:
##########
@@ -42,14 +43,19 @@ class ShowBootstrapPartitionsProcedure extends
BaseProcedure with ProcedureBuild
super.checkArgs(PARAMETERS, args)
val tableName = getArgValueOrDefault(args, PARAMETERS(0))
+ val limit = getArgValueOrDefault(args, PARAMETERS(1))
val basePath: String = getBasePath(tableName)
val metaClient =
HoodieTableMetaClient.builder.setConf(jsc.hadoopConfiguration()).setBasePath(basePath).build
val indexReader = createBootstrapIndexReader(metaClient)
val indexedPartitions = indexReader.getIndexedPartitionPaths
- indexedPartitions.stream().toArray.map(r => Row(r)).toList
+ if (limit.isDefined) {
+
indexedPartitions.stream().limit(limit.get.asInstanceOf[Int]).toArray.map(r =>
Row(r)).toList
+ } else {
Review Comment:
There could many partitions here? It is still makes sense to represent
pruned result list?
--
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]