You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/06/07 05:07:51 UTC
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8848: Fix multi value column index creation
Jackie-Jiang commented on code in PR #8848:
URL: https://github.com/apache/pinot/pull/8848#discussion_r890769840
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java:
##########
@@ -386,30 +386,78 @@ public void indexRow(GenericRow row)
// bloom filter
BloomFilterCreator bloomFilterCreator = _bloomFilterCreatorMap.get(columnName);
if (bloomFilterCreator != null) {
- bloomFilterCreator.add(columnValueToIndex.toString());
+ if (fieldSpec.isSingleValueField()) {
+ bloomFilterCreator.add(columnValueToIndex.toString());
+ } else {
+ Object[] values = (Object[]) columnValueToIndex;
+ for (Object value: values) {
+ bloomFilterCreator.add(value.toString());
+ }
+ }
}
// range index
CombinedInvertedIndexCreator combinedInvertedIndexCreator = _rangeIndexFilterCreatorMap.get(columnName);
if (combinedInvertedIndexCreator != null) {
if (dictionaryCreator != null) {
Review Comment:
Suggest for checking SV then dictionary. MV is always dictionary encoded:
```
if (fieldSpec.isSingleValueField()) {
if (dictionaryCreator != null) {
...
} else {
switch ...
}
} else {
assert dictionaryCreator != null;
...
}
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java:
##########
@@ -386,30 +386,78 @@ public void indexRow(GenericRow row)
// bloom filter
BloomFilterCreator bloomFilterCreator = _bloomFilterCreatorMap.get(columnName);
if (bloomFilterCreator != null) {
- bloomFilterCreator.add(columnValueToIndex.toString());
+ if (fieldSpec.isSingleValueField()) {
+ bloomFilterCreator.add(columnValueToIndex.toString());
+ } else {
+ Object[] values = (Object[]) columnValueToIndex;
+ for (Object value: values) {
Review Comment:
(format)
```suggestion
for (Object value : values) {
```
--
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