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: [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]

Reply via email to