itschrispeck commented on code in PR #13164:
URL: https://github.com/apache/pinot/pull/13164#discussion_r1612662546
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/JsonExtractIndexTransformFunction.java:
##########
@@ -411,4 +407,18 @@ public String[][] transformToStringValuesMV(ValueBlock
valueBlock) {
}
return _stringValuesMV;
}
+
+ /**
+ * Lazily initialize _valueToMatchingDocsMap, so that map generation is
skipped when filtering excludes all values
+ */
+ private Map<String, RoaringBitmap> getValueToMatchingDocsMap() {
+ if (_valueToMatchingDocsMap == null) {
Review Comment:
It's a lazy initialization pattern, so the first time the method is called
it will build the map. Subsequent calls will use the already built map. The
pattern lets us avoid pre-building the map in transform function's `init`
method since we might never need it, instead it is built when transforming the
first `ValueBlock`
--
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]