gortiz commented on code in PR #13303:
URL: https://github.com/apache/pinot/pull/13303#discussion_r1670150709
##########
pinot-common/src/main/java/org/apache/pinot/common/datablock/BaseDataBlock.java:
##########
@@ -290,84 +232,117 @@ public ByteArray getBytes(int rowId, int colId) {
@Override
public int[] getIntArray(int rowId, int colId) {
- int length = positionOffsetInVariableBufferAndGetLength(rowId, colId);
- int[] ints = new int[length];
- for (int i = 0; i < length; i++) {
- ints[i] = _variableSizeData.getInt();
+ int offsetInFixed = getOffsetInFixedBuffer(rowId, colId);
+ int size = _fixedSizeData.getInt(offsetInFixed + 4);
+ int offsetInVar = _fixedSizeData.getInt(offsetInFixed);
+
+ int[] ints = new int[size];
+ try (PinotInputStream stream =
_variableSizeData.openInputStream(offsetInVar)) {
Review Comment:
It simplifies the code a bit. The stream is just an object with a single
long, so I hope it will be scalar replaced by the jit.
--
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]