raghavyadav01 opened a new pull request, #19111:
URL: https://github.com/apache/pinot/pull/19111
## Problem
Configuring a range index on an ingestion-aggregated metric column causes
segments to fail to commit.
Ingestion-time metrics aggregation (`aggregationConfigs`, or the legacy
`aggregateMetrics` flag) forces its aggregated metric columns to be
no-dictionary, and their min/max values are never tracked while the consuming
segment is being built. The BitSliced range index (version 2) creator reads
min/max for a single-value no-dictionary column:
```java
// RangeIndexType.createIndexCreator
return new BitSlicedRangeIndexCreator(context.getIndexDir(), fieldSpec,
context.getMinValue(), context.getMaxValue()); // min/max are null here
```
For INT/LONG columns this throws a `NullPointerException` at segment build
time (`((Number) minValue).longValue()`); for FLOAT/DOUBLE it silently builds a
degenerate index over a wrong value domain. Either way, the affected real-time
segments can never commit.
## Fix
1. **`RangeIndexType.validate()`** — reject a version-2 range index on a
single-value, no-dictionary, ingestion-aggregated column upfront, with an
actionable message. Scoped to `REALTIME` tables, since ingestion aggregation
only materializes on consuming segments (the offline path computes min/max
normally and is unaffected). Version-1 range index does not read min/max and is
left allowed.
2. **`BitSlicedRangeIndexCreator`** — defense-in-depth: the raw-column
constructor now fails with a clear `IllegalStateException` when min/max are
absent, instead of a bare `NullPointerException`. This also covers
direct/programmatic creation and segment reload paths that config validation
does not gate.
## Testing
- `IndexCombinationValidationTest` — both aggregation paths are rejected for
real-time tables; version-1 range index passes; a non-aggregated no-dictionary
numeric column still supports the range index; the same config on an offline
table is allowed.
- `BitSlicedIndexCreatorTest` — added a test that the raw-column constructor
fails loudly on absent min/max.
## Release Notes
Configuring a version-2 (BitSliced) range index on an ingestion-aggregated
no-dictionary column is now rejected at table-config validation time. Use range
index version 1, or remove the range index on such columns.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]