Document and test table name override on segment push - #19085
Conversation
Operators already can push a segment tar into a different table via the tableName request parameter, but metadata mismatch was opaque. Log override clearly, document CLI -tableName, and cover staging-to-prod upload in tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19085 +/- ##
============================================
+ Coverage 65.47% 65.49% +0.02%
Complexity 1421 1421
============================================
Files 3426 3426
Lines 217315 217324 +9
Branches 34509 34511 +2
============================================
+ Hits 142283 142341 +58
+ Misses 63513 63471 -42
+ Partials 11519 11512 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| String rawTableName = TableNameBuilder.extractRawTableName(requestTableName); | ||
| if (StringUtils.isNotEmpty(metadataTableName)) { | ||
| String metadataRawTableName = TableNameBuilder.extractRawTableName(metadataTableName); | ||
| if (!rawTableName.equals(metadataRawTableName)) { |
There was a problem hiding this comment.
Suggest keeping the original logic. The goal is to decouple table name from segment metadata
There was a problem hiding this comment.
Thanks for the review, that makes sense. The extracted helper reads segmentMetadata.getTableName() even when the request param is present (to log a mismatch), which adds a new dependency on the metadata table name and works against the decoupling goal. I will revert this hunk to the original inline logic so the metadata table name is only read in the fallback path when the query param is absent, and drop the extra comparison and info log. The PR will then keep only the documentation updates on the upload endpoints' tableName ApiParam and the UploadSegmentCommand -tableName option, plus test coverage for the override behavior, which I will rework so it no longer depends on the extracted helper.
Why
Data engineers often build segments once and promote staging → prod (or clone tables) without rebuilding. The controller already prefers the request
tableNameoversegment.table.namein metadata, but that override was under-documented and easy to misuse when the param was omitted (silent fallback to baked metadata).Impact
-tableName/ query param is the override; metadata name is fallback only.How
-tableNameas override of bakedsegment.table.name.Test plan
PinotSegmentUploadDownloadRestletResourceTest(or related) override coverage../mvnw -pl pinot-controller -am -Dtest=PinotSegmentUploadDownloadRestletResourceTest -Dsurefire.failIfNoSpecifiedTests=false testRelated
closes: #5427
Reviewers
Suggested: xiangfu0
Was generative AI tooling used to co-author this PR?
Generated-by: Grok Build (xAI)