You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "itschrispeck (via GitHub)" <gi...@apache.org> on 2024/11/13 23:58:05 UTC
[PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
itschrispeck opened a new pull request, #14444:
URL: https://github.com/apache/pinot/pull/14444
We see some mild improvements from using fixed length dictionaries when all values of a column in a segment are the same length. Since we programmatically manage our columns and use other optimizeDictionary functionality, we'd like to programmatically choose the dictionary type as well.
Previously the [creation info](https://github.com/apache/pinot/blob/e23d17aab416fbfb6e5362983a8574fc58b07913/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java#L564-L565) is ignored during segment conversion. When the new config `optimizeDictionaryType` is true, then the creation info is used to determine the dictionary type (fixed width or var width). Tested in our internal cluster, inspected the log added and verified fixed length cols such as hash/uuid only cols use fixed dict, and variable length data uses var dict.
This PR also contains some minor fixes in TableConfigBuilder for missing configs.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #14444:
URL: https://github.com/apache/pinot/pull/14444#issuecomment-2475112838
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/14444?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `37.50000%` with `15 lines` in your changes missing coverage. Please review.
> Project coverage is 55.38%. Comparing base [(`59551e4`)](https://app.codecov.io/gh/apache/pinot/commit/59551e45224f1535c4863fd577622b37366ccc97?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`a29040a`)](https://app.codecov.io/gh/apache/pinot/commit/a29040a384634c6427fb4df28f2bede4c318fdb2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1324 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/14444?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...he/pinot/spi/utils/builder/TableConfigBuilder.java](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&filepath=pinot-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fspi%2Futils%2Fbuilder%2FTableConfigBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvYnVpbGRlci9UYWJsZUNvbmZpZ0J1aWxkZXIuamF2YQ==) | 33.33% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ment/creator/impl/SegmentColumnarIndexCreator.java](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Fsegment%2Fcreator%2Fimpl%2FSegmentColumnarIndexCreator.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9zZWdtZW50L2NyZWF0b3IvaW1wbC9TZWdtZW50Q29sdW1uYXJJbmRleENyZWF0b3IuamF2YQ==) | 0.00% | [3 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ot/segment/spi/creator/SegmentGeneratorConfig.java](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&filepath=pinot-segment-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Fspi%2Fcreator%2FSegmentGeneratorConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1zcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3Bpbm90L3NlZ21lbnQvc3BpL2NyZWF0b3IvU2VnbWVudEdlbmVyYXRvckNvbmZpZy5qYXZh) | 40.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...pinot/segment/spi/index/DictionaryIndexConfig.java](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&filepath=pinot-segment-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Fspi%2Findex%2FDictionaryIndexConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1zcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3Bpbm90L3NlZ21lbnQvc3BpL2luZGV4L0RpY3Rpb25hcnlJbmRleENvbmZpZy5qYXZh) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/14444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (59551e4) and HEAD (a29040a). Click for more details.
>
> <details><summary>HEAD has 53 uploads less than BASE</summary>
>
>| Flag | BASE (59551e4) | HEAD (a29040a) |
>|------|------|------|
>|integration|7|0|
>|integration2|3|0|
>|temurin|12|1|
>|java-21|7|1|
>|skip-bytebuffers-true|3|1|
>|skip-bytebuffers-false|7|0|
>|unittests|5|1|
>|unittests1|2|1|
>|java-11|5|0|
>|unittests2|3|0|
>|integration1|2|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #14444 +/- ##
============================================
- Coverage 61.75% 55.38% -6.38%
- Complexity 207 697 +490
============================================
Files 2436 2096 -340
Lines 133233 110425 -22808
Branches 20636 17513 -3123
============================================
- Hits 82274 61154 -21120
+ Misses 44911 44402 -509
+ Partials 6048 4869 -1179
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-11](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.38% <37.50%> (-6.25%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.38% <37.50%> (+27.65%)` | :arrow_up: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.38% <37.50%> (-6.38%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.38% <37.50%> (-6.37%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.38% <37.50%> (+8.48%)` | :arrow_up: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/14444/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/14444?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "itschrispeck (via GitHub)" <gi...@apache.org>.
itschrispeck commented on code in PR #14444:
URL: https://github.com/apache/pinot/pull/14444#discussion_r1844709969
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java:
##########
@@ -182,6 +182,14 @@ public void init(SegmentGeneratorConfig segmentCreationSpec, SegmentIndexCreatio
LOGGER.info("Creating dictionary index in column {}.{} even when it is disabled in config",
segmentCreationSpec.getTableName(), columnName);
}
+
+ // override dictionary type if configured to do so
+ if (_config.isOptimizeDictionaryType()) {
+ LOGGER.info("Overriding dictionary type for column: {} using var-length dictionary: {}", columnName,
+ columnIndexCreationInfo.isUseVarLengthDictionary());
+ dictConfig = new DictionaryIndexConfig(dictConfig, columnIndexCreationInfo.isUseVarLengthDictionary());
Review Comment:
It is whichever is specified in the table config, the addition option will ignore the static config and use column index creation info - it does not necessary go var -> fixed or fixed -> var, so I think naming should stay generic
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "deemoliu (via GitHub)" <gi...@apache.org>.
deemoliu commented on code in PR #14444:
URL: https://github.com/apache/pinot/pull/14444#discussion_r1852799889
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java:
##########
@@ -553,9 +553,8 @@ void collectStatsAndIndexCreationInfo()
ColumnStatistics columnProfile = _segmentStats.getColumnProfileFor(column);
DictionaryIndexConfig dictionaryIndexConfig = indexConfigsMap.get(column).getConfig(StandardIndexes.dictionary());
boolean createDictionary = dictionaryIndexConfig.isDisabled();
- boolean useVarLengthDictionary =
- dictionaryIndexConfig.getUseVarLengthDictionary() || DictionaryIndexType.shouldUseVarLengthDictionary(
- storedType, columnProfile);
+ boolean useVarLengthDictionary = dictionaryIndexConfig.getUseVarLengthDictionary()
+ || DictionaryIndexType.optimizeTypeShouldUseVarLengthDictionary(storedType, columnProfile);
Review Comment:
will this change backward compatibility? A new check `columnStoredType == FieldSpec.DataType.STRING` is being added?
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "deemoliu (via GitHub)" <gi...@apache.org>.
deemoliu commented on code in PR #14444:
URL: https://github.com/apache/pinot/pull/14444#discussion_r1852898349
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java:
##########
@@ -553,9 +553,8 @@ void collectStatsAndIndexCreationInfo()
ColumnStatistics columnProfile = _segmentStats.getColumnProfileFor(column);
DictionaryIndexConfig dictionaryIndexConfig = indexConfigsMap.get(column).getConfig(StandardIndexes.dictionary());
boolean createDictionary = dictionaryIndexConfig.isDisabled();
- boolean useVarLengthDictionary =
- dictionaryIndexConfig.getUseVarLengthDictionary() || DictionaryIndexType.shouldUseVarLengthDictionary(
- storedType, columnProfile);
+ boolean useVarLengthDictionary = dictionaryIndexConfig.getUseVarLengthDictionary()
+ || DictionaryIndexType.optimizeTypeShouldUseVarLengthDictionary(storedType, columnProfile);
Review Comment:
thanks for sharing the context. stamped.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "deemoliu (via GitHub)" <gi...@apache.org>.
deemoliu commented on code in PR #14444:
URL: https://github.com/apache/pinot/pull/14444#discussion_r1842855965
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java:
##########
@@ -182,6 +182,14 @@ public void init(SegmentGeneratorConfig segmentCreationSpec, SegmentIndexCreatio
LOGGER.info("Creating dictionary index in column {}.{} even when it is disabled in config",
segmentCreationSpec.getTableName(), columnName);
}
+
+ // override dictionary type if configured to do so
+ if (_config.isOptimizeDictionaryType()) {
+ LOGGER.info("Overriding dictionary type for column: {} using var-length dictionary: {}", columnName,
+ columnIndexCreationInfo.isUseVarLengthDictionary());
+ dictConfig = new DictionaryIndexConfig(dictConfig, columnIndexCreationInfo.isUseVarLengthDictionary());
Review Comment:
what is the default dictionary type? shall we name it `OptimizeWithVarLengthDictionaryType`?
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "itschrispeck (via GitHub)" <gi...@apache.org>.
itschrispeck commented on code in PR #14444:
URL: https://github.com/apache/pinot/pull/14444#discussion_r1852893839
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java:
##########
@@ -553,9 +553,8 @@ void collectStatsAndIndexCreationInfo()
ColumnStatistics columnProfile = _segmentStats.getColumnProfileFor(column);
DictionaryIndexConfig dictionaryIndexConfig = indexConfigsMap.get(column).getConfig(StandardIndexes.dictionary());
boolean createDictionary = dictionaryIndexConfig.isDisabled();
- boolean useVarLengthDictionary =
- dictionaryIndexConfig.getUseVarLengthDictionary() || DictionaryIndexType.shouldUseVarLengthDictionary(
- storedType, columnProfile);
+ boolean useVarLengthDictionary = dictionaryIndexConfig.getUseVarLengthDictionary()
+ || DictionaryIndexType.optimizeTypeShouldUseVarLengthDictionary(storedType, columnProfile);
Review Comment:
Good question - it won't, since this value `useVarLengthDictionary` is currently set but unused. Only when the new config is set to true, it will be used (false by default)
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Add `optimizeDictionaryType` config to automatically choose dictionary type [pinot]
Posted by "deemoliu (via GitHub)" <gi...@apache.org>.
deemoliu merged PR #14444:
URL: https://github.com/apache/pinot/pull/14444
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org