KKcorps commented on code in PR #11262: URL: https://github.com/apache/pinot/pull/11262#discussion_r1299166435
########## pinot-core/src/main/java/org/apache/pinot/core/common/datatable/BaseDataTableBuilder.java: ########## @@ -105,10 +105,16 @@ public void setColumn(int colId, @Nullable Object value) _currentRowDataByteBuffer.putInt(0); _variableSizeDataOutputStream.writeInt(CustomObject.NULL_TYPE_VALUE); } else { - int objectTypeValue = ObjectSerDeUtils.ObjectType.getObjectType(value).getValue(); + ObjectSerDeUtils.ObjectType objectType = ObjectSerDeUtils.ObjectType.getObjectType(value); + int objectTypeValue = objectType.getValue(); byte[] bytes = ObjectSerDeUtils.serialize(value, objectTypeValue); + //TODO: Remove this if clause we integrate vector type into the data table like BigDecimal + // Currently we are using int to store objectTypeValue but we don't add 4 to byte array length which messes up the vector deserialization + // Is this a bug? Should we fix it? _currentRowDataByteBuffer.putInt(bytes.length); - _variableSizeDataOutputStream.writeInt(objectTypeValue); + if (objectType != ObjectSerDeUtils.ObjectType.Vector) { + _variableSizeDataOutputStream.writeInt(objectTypeValue); Review Comment: @xiangfu0 @walterddr I found this weird case inside the codebase where we are putting `bytes.length` as the size but the actual value is `bytes.length + 4` cause we are also writing objectTypeValue to same buffer. Is this a bug or am I missing something? -- 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