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/12 20:53:18 UTC

[GitHub] [pinot] zhtaoxiang commented on a diff in pull request #8879: [Draft] extract sort fields into a temp file for better data locality for sorting

zhtaoxiang commented on code in PR #8879:
URL: https://github.com/apache/pinot/pull/8879#discussion_r895231923


##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/genericrow/GenericRowSerializer.java:
##########
@@ -237,4 +173,72 @@ public byte[] serialize(GenericRow row) {
 
     return serializedBytes;
   }
+
+  public void serializeField(GenericRow row, ByteBuffer byteBuffer, int fieldIndex) {
+    Object value = row.getValue(_fieldNames[fieldIndex]);
+
+    if (_isSingleValueFields[fieldIndex]) {
+      switch (_storedTypes[fieldIndex]) {
+        case INT:
+          byteBuffer.putInt((int) value);
+          break;
+        case LONG:
+          byteBuffer.putLong((long) value);
+          break;
+        case FLOAT:
+          byteBuffer.putFloat((float) value);
+          break;
+        case DOUBLE:
+          byteBuffer.putDouble((double) value);
+          break;
+        case STRING:
+          byte[] stringBytes = (byte[]) _stringBytes[fieldIndex];
+          byteBuffer.putInt(stringBytes.length);

Review Comment:
   this line throws NPE during the test.



-- 
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