xiangfu0 opened a new pull request, #18412:
URL: https://github.com/apache/pinot/pull/18412
## Summary
- remove `_indexTypes` as stored `FieldConfig` state and normalize legacy
`indexType`/`indexTypes` into `indexes` at construction time
- keep legacy TEXT, H3, and VECTOR field config details when materializing
normalized `indexes`
- update index deserializers/tests to consume normalized `indexes`, while
preserving table-level range-index version fallback
## User Manual
Pinot still accepts legacy `fieldConfigList` entries that use `indexType` or
`indexTypes`.
After this change:
- legacy `indexType` and `indexTypes` are converted into `indexes` during
deserialization
- serialized table configs only emit `indexes`; Pinot no longer writes back
`indexType` or `indexTypes`
- `getIndexType()` and `getIndexTypes()` continue to work as derived
compatibility accessors backed by normalized `indexes`
- legacy range index configs still honor the table-level range index version
when no per-field version is set
## Sample Table Config
Legacy input:
```json
{
"fieldConfigList": [
{
"name": "message",
"encodingType": "RAW",
"indexType": "TEXT",
"properties": {
"stopWordInclude": "pinot,apache",
"enableQueryCacheForTextIndex": "true"
}
},
{
"name": "cityId",
"indexTypes": ["INVERTED", "RANGE"]
}
]
}
```
Normalized form written back by Pinot:
```json
{
"fieldConfigList": [
{
"name": "message",
"encodingType": "RAW",
"indexes": {
"text": {
"disabled": false,
"queryCache": true,
"stopWordsInclude": ["pinot", "apache"]
}
},
"properties": {
"stopWordInclude": "pinot,apache",
"enableQueryCacheForTextIndex": "true"
}
},
{
"name": "cityId",
"encodingType": "DICTIONARY",
"indexes": {
"inverted": {
"disabled": false
},
"range": {
"disabled": false
}
}
}
]
}
```
## Testing
- `./mvnw spotless:apply -pl pinot-spi,pinot-common,pinot-segment-local -am`
- `./mvnw checkstyle:check -pl pinot-spi,pinot-common,pinot-segment-local
-am`
- `./mvnw license:format -pl pinot-spi,pinot-common,pinot-segment-local -am`
- `./mvnw license:check -pl pinot-spi,pinot-common,pinot-segment-local -am`
- `./mvnw -pl pinot-common,pinot-segment-local -am
-Dtest=TableConfigSerDeUtilsTest,TextIndexTest,RangeIndexTest,InvertedIndexTypeTest,H3IndexTest,VectorIndexTest,JsonIndexTest,FstIndexTypeTest
-Dsurefire.failIfNoSpecifiedTests=false test`
--
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]