PakhomovAlexander commented on code in PR #4142:
URL: https://github.com/apache/ignite-3/pull/4142#discussion_r1712073094
##########
modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/inlineschema/TupleWithSchemaMarshalling.java:
##########
@@ -65,64 +71,105 @@ public final class TupleWithSchemaMarshalling {
types[i] = inferType(value);
}
- BinaryTupleBuilder builder = builder(values, columns, types);
+ BinaryTupleBuilder schemaBuilder = schemaBuilder(columns, types);
+ BinaryTupleBuilder valueBuilder = valueBuilder(values, types);
+
+ byte[] schemaBt = schemaBuilder.build().array();
+ byte[] valueBt = valueBuilder.build().array();
+ // Size: int32 (tuple size), int32 (value offset), schema, value.
+ byte[] result = new byte[4 + 4 + schemaBt.length + valueBt.length];
- byte[] arr = builder.build().array();
- byte[] result = new byte[arr.length + 1];
- // Put the size of the schema in the first byte.
- result[0] = (byte) size; // todo should be int32
+ // Put the size of the schema in the first 4 bytes.
+ result[0] = (byte) (size >> 24);
Review Comment:
Thanks, I've decided to copy methods from `HeapByteBufUtil`. The reason why
I have not reused this class directly is that it has package-private methods
and requires changes. But I do not want to modify this class since it is
forked.
--
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]