Copilot commented on code in PR #7612:
URL: https://github.com/apache/paimon/pull/7612#discussion_r3055206355


##########
paimon-spark/paimon-spark3-common/src/main/scala/org/apache/paimon/spark/commands/PaimonShowTablePartitionCommand.scala:
##########
@@ -87,7 +88,20 @@ case class PaimonShowTablePartitionCommand(
     val partitionValues = partitions.mkString("[", ", ", "]")
     results.put("Partition Values", s"$partitionValues")
 
-    // TODO "Partition Parameters", "Created Time", "Last Access", "Partition 
Statistics"
+    // Partition Parameters and Partition Statistics
+    val metadata = partitionTable.loadPartitionMetadata(row)
+    if (!metadata.isEmpty) {
+      val metadataMap = metadata.asScala
+      results.put(
+        "Partition Parameters",
+        s"{${metadataMap.map { case (k, v) => s"$k=$v" }.mkString(", ")}}")
+
+      val fileSizeInBytes =
+        metadataMap.getOrElse(PartitionStatistics.FIELD_FILE_SIZE_IN_BYTES, 
"0").toLong
+      val recordCount =
+        metadataMap.getOrElse(PartitionStatistics.FIELD_RECORD_COUNT, 
"0").toLong
+      results.put("Partition Statistics", s"$recordCount rows, 
$fileSizeInBytes bytes")
+    }

Review Comment:
   The command now adds a new "Partition Statistics" line (derived from 
`loadPartitionMetadata`), but the updated unit test only asserts that partition 
parameters exist and that `recordCount` has expected values. Add an assertion 
that the output includes the "Partition Statistics" section (and ideally that 
it reflects the expected row count / byte size) so this new user-facing 
behavior is covered and less likely to regress.



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