Copilot commented on code in PR #18872:
URL: https://github.com/apache/pinot/pull/18872#discussion_r3681103755
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/InTransformFunction.java:
##########
@@ -203,11 +212,20 @@ public int[] transformToIntValuesSV(ValueBlock
valueBlock) {
}
break;
case BYTES:
- ObjectOpenHashSet<ByteArray> inBytesValues =
(ObjectOpenHashSet<ByteArray>) _valueSet;
byte[][] bytesValues =
_mainFunction.transformToBytesValuesSV(valueBlock);
- for (int i = 0; i < length; i++) {
- if (inBytesValues.contains(new ByteArray(bytesValues[i]))) {
- _intValuesSV[i] = 1;
+ if (_mainFunction.getResultMetadata().getDataType() ==
DataType.UUID) {
+ ObjectOpenHashSet<UuidKey> inUuidValues =
(ObjectOpenHashSet<UuidKey>) _valueSet;
+ for (int i = 0; i < length; i++) {
+ if (inUuidValues.contains(UuidKey.fromBytes(bytesValues[i]))) {
+ _intValuesSV[i] = 1;
Review Comment:
The UUID path allocates a new `UuidKey` per document
(`UuidKey.fromBytes(...)`) inside the per-doc scan loop. This can create very
high allocation/GC pressure for large scans. Consider switching the UUID value
set to be keyed on raw `byte[]` with value semantics (e.g., fastutil
`ObjectOpenCustomHashSet<byte[]>` + `ByteArrays.HASH_STRATEGY`) so the scan
path can probe with the already-scanned `byte[]` directly (no wrapper
allocation).
--
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]