Commit 78f0bb6
Document reserved -1 sentinel contract on PartitionFunction.getPartition
Major fix:
- PartitionFunction.getPartition(String) Javadoc now explicitly states
the return-value contract: implementations must return non-negative
partition ids in [0, getNumPartitions()), and -1 is reserved as a
framework-internal sentinel for "expression evaluated to null"
(PartitionPipelineFunction.NULL_RESULT_PARTITION_ID). Custom plugin
partition functions must not return -1 as a real partition id;
internal callers (broker pruner, stats collector, segment processing
partitioner) treat -1 as "skip / no partition".
Skipped findings (with rationale):
- Broker pruner fail-open metric: requires introducing a new
BrokerMeter; defer to a follow-up that adds the meter alongside
similar pruning failure observability.
- End-to-end integration test: substantial test infrastructure work
(CustomDataQueryClusterIntegrationTest subclass with controller +
realtime ingestion + broker routing assertions); defer.
- PR-scope split: process feedback that requires coordinated landing
with maintainers; out of scope for code-only fixes.
- Cross-version controller-side gate: substantial Helix integration;
documented hazard in ColumnPartitionConfig Javadoc, defer.
- ColumnBoundPartitionFunction.evaluate null handling: reviewer's
claim that legacy partition functions produced a deterministic
partition id for null is incorrect — legacy
PartitionFunction.getPartition(String) would NPE on
value.getBytes(UTF_8). The wrapper's null→null conversion is a
graceful improvement.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6da3be7 commit 78f0bb6
1 file changed
Lines changed: 8 additions & 1 deletion
File tree
- pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/partition
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | | - | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments