Repository navigation
Add batched table stats collection spark app - #789
Merged
Merged
Conversation
mkuchenbecker
left a comment
Collaborator
There was a problem hiding this comment.
What are your thoughts on the app having a metrics sink rather than extending and overriding a function that logs? Then we can test it end to end with a generic sink and this app is functionally complete rather than a logger.
Member
Author
Good call - switched from overridable logging methods to an injected sink.
|
mkuchenbecker
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
BatchedTableStatsCollectionSparkApp— the multi-table Spark app that runs table stats collection for a bin of tables in a single job, mirroringBatchedOrphanFilesDeletionSparkApp. This is the execution side for the optimizer's stats-collection operation: the scheduler bin-packsTABLE_STATS_COLLECTIONops (by file count) and submits one job per bin; this app processes that bin.Motivation
The optimizer can now analyze and bin-pack
TABLE_STATS_COLLECTIONoperations, but there was no batched Spark app to execute a bin. The single-tableTableStatsCollectionSparkAppremains the unit when bin size is 1; this app processes many(table, operationId)pairs in one job so bin-packing actually reduces the number of Spark jobs.Changes
BatchedTableStatsCollectionSparkApp(new)BaseSparkApp; one job processes a list of(fqtn, operationId, tableUuid)the scheduler packed into a bin.--tableNames,--operationIds,--tableUuids(parallel CSV lists),--resultsEndpoint,--driverParallelism.collectTableStats+ commit events + partition events + partition stats), then posts the per-operation outcome to the Optimizer Service withoperationType = TABLE_STATS_COLLECTION.Throwable, reportsFAILEDfor its own operation, and the job continues; the job exits 0 if ≥1 table succeeds and throws only if all fail.collectTableStatsmarks that table FAILED (so the analyzer's failure cadence retries it); commit-/partition-level artifacts are best-effort.SCHEDULED(logged + counted) for the analyzer's stale-timeout rather than silently dropping.Supporting changes
api/spec/OperationType: addTABLE_STATS_COLLECTION, so the generated optimizer client'sUpdateOperationRequest.OperationTypeEnumincludes it forreportResult.AppConstants: addSTATS_MAX_BATCH_SIZE = 100— a footgun guard against an oversized batch OOMing the driver (the scheduler's per-bin table cap defaults to 25; this is the hard ceiling).Intentional differences from
BatchedOrphanFilesDeletionSparkAppIssue] Briefly discuss the summary of the changes made in this
pull request in 2-3 lines.
For all the boxes checked, please include additional details of the changes made in this pull request.
Testing Done
./gradlew clean buildpassedBatchedTableStatsCollectionSparkAppArgsTest(pure-Java, 7 cases): parallel-list parsing,whitespace trimming, optional lists, mismatched-length rejection, non-qualified name rejection,
and the
STATS_MAX_BATCH_SIZEguard.:apps:openhouse-spark-apps_2.12compiles (the optimizer client regenerates from the updated specwith
TABLE_STATS_COLLECTION) and the test suite passes (Java 17).For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.
Additional Information
For all the boxes checked, include additional details of the changes made in this pull request.