You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "sundapeng (via GitHub)" <gi...@apache.org> on 2026/08/18 15:55:04 UTC

[PR] [core][spark] Measure format table partitions in MSCK REPAIR TABLE [paimon]

sundapeng opened a new pull request, #9297:
URL: https://github.com/apache/paimon/pull/9297

   > **Stacked on #9295 and #9296** — their commits show up here too until they merge. Review only
   > `[core][spark] Measure format table partitions in MSCK REPAIR TABLE`.
   
   ### Purpose
   
   A commit reports what it wrote (#9296). Nothing reports what is already there, and for a format
   table plenty is: partitions written by something that is not Paimon, files deleted out of band, an
   increment redelivered and counted twice. MSCK REPAIR TABLE is already the command that reconciles
   the partition set against the directories, so it is the natural place to reconcile the numbers too.
   
   Off by default, behind `spark.paimon.format-table.repair.collect-statistics`, because measuring
   changes what a repair costs: the plain diff lists partition directories, and measuring lists the
   files inside every one of them. That is a different order of magnitude on a table with many
   partitions, and a repair should not silently become that. When it is on,
   `spark.paimon.format-table.statistics.parallelism` caps how many partitions are measured at once, at
   8: listing one is a round trip the driver spends waiting on, and the cap keeps a table with many
   partitions from turning that wait into a burst of requests.
   
   When on it measures every partition that ends up registered with a directory behind it, not only the
   ones it just added. The stale numbers of partitions written outside Paimon are exactly what a repair
   exists to correct. Without ADD it stays inside the already-registered set, so measuring never
   registers a partition the command was not asked to.
   
   ### What the collector reports
   
   What a reader would see. File count, byte size and last file creation time come from the listing. It
   stops there: the row count needs a file footer, which is what ANALYZE is for. A listing failure
   aborts the whole collection rather than reporting what it managed to see, because a truncated
   listing is indistinguishable from a partition that lost files. A partition whose directory is gone
   measures as an exact zero, with no last file to date.
   
   ### Tests
   
   - `FormatTablePartitionStatsCollectorTest`: the staging trees a committer leaves behind, exact
     parquet row counts, an unreadable footer, a missing directory, the one-for-one alignment of the
     result with the given specs, a spec that omits a partition key, and a listing failure aborting the
     whole collection on both the serial and the parallel path.
   - `FormatTablePartitionRepairTest`: measuring every partition on disk rather than only the
     additions, a repair without ADD registering nothing, and a listing failure leaving the catalog
     untouched.
   - `CatalogManagedPartitionMsckRepairTest`: the command end to end with the option off and on.
   
   ### API and Format
   
   Two new Spark options, both off or bounded by default. No API or format change.
   
   ### Documentation
   
   Both options are described in the generated Spark connector configuration table.
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Support collecting format table partition statistics in MSCK REPAIR TABLE [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #9297:
URL: https://github.com/apache/paimon/pull/9297#discussion_r3826380064


##########
docs/generated/spark_connector_configuration.html:
##########
@@ -26,6 +26,18 @@
         </tr>
     </thead>
     <tbody>
+        <tr>
+            <td><h5>format-table.repair.collect-statistics</h5></td>
+            <td style="word-wrap: break-word;">false</td>

Review Comment:
   Default value should be true?



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Support collecting format table partition statistics in MSCK REPAIR TABLE [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #9297:
URL: https://github.com/apache/paimon/pull/9297#discussion_r3826380064


##########
docs/generated/spark_connector_configuration.html:
##########
@@ -26,6 +26,18 @@
         </tr>
     </thead>
     <tbody>
+        <tr>
+            <td><h5>format-table.repair.collect-statistics</h5></td>
+            <td style="word-wrap: break-word;">false</td>

Review Comment:
   Default value should be true?



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Support collecting format table partition statistics in MSCK REPAIR TABLE [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #9297:
URL: https://github.com/apache/paimon/pull/9297


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org