Jackie-Jiang commented on code in PR #8674:
URL: https://github.com/apache/pinot/pull/8674#discussion_r898551015


##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/readers/PrimaryKey.java:
##########
@@ -26,12 +26,16 @@
  * The primary key of a record. Note that the value used in the primary key 
must be single-value.
  */
 public class PrimaryKey {
-  private final Object[] _values;
+  private Object[] _values;

Review Comment:
   Let's not change this class. We don't want to replace the underlying value 
buffer



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/IntermediateSegment.java:
##########
@@ -224,6 +225,20 @@ public GenericRow getRecord(int docId, GenericRow reuse) {
     return reuse;
   }
 
+  @Override
+  public void getPrimaryKey(int docId, PrimaryKey reuse) {
+    int numPrimaryKeyColumns = _schema.getPrimaryKeyColumns().size();
+    Object[] values = new Object[numPrimaryKeyColumns];;

Review Comment:
   We don't want to create new value buffer, use the one within the reuse 
primary key instead. Same for other places
   ```suggestion
       Object[] values = reuse.getValues();
   ```



-- 
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-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to