Fokko commented on code in PR #2652:
URL: https://github.com/apache/avro/pull/2652#discussion_r1469329181
##########
lang/java/avro/src/main/java/org/apache/avro/Conversions.java:
##########
@@ -68,6 +69,22 @@ public UUID fromCharSequence(CharSequence value, Schema
schema, LogicalType type
public CharSequence toCharSequence(UUID value, Schema schema, LogicalType
type) {
return value.toString();
}
+
+ @Override
+ public UUID fromFixed(final GenericFixed value, final Schema schema, final
LogicalType type) {
+ ByteBuffer buffer = ByteBuffer.wrap(value.bytes());
+ long mostSigBits = buffer.getLong();
+ long leastSigBits = buffer.getLong();
+ return new UUID(mostSigBits, leastSigBits);
+ }
+
+ @Override
+ public GenericFixed toFixed(final UUID value, final Schema schema, final
LogicalType type) {
+ ByteBuffer buffer = ByteBuffer.allocate(2 * Long.BYTES);
Review Comment:
I'm not fully comprehending the section 4.1.2. It is meant to clarify the
byte order, but it doesn't help me a a lot:
> The fields are presented with the most significant one first.
That translates to big-endianness to me.
--
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]