nastra commented on code in PR #7399:
URL: https://github.com/apache/iceberg/pull/7399#discussion_r1175364019


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcValueReaders.java:
##########
@@ -170,6 +177,31 @@ public UTF8String nonNullRead(ColumnVector vector, int 
row) {
     }
   }
 
+  private static class UUIDReader implements OrcValueReader<UTF8String> {
+    private static final ThreadLocal<ByteBuffer> BUFFER =
+        ThreadLocal.withInitial(
+            () -> {
+              ByteBuffer buffer = ByteBuffer.allocate(16);
+              buffer.order(ByteOrder.BIG_ENDIAN);
+              return buffer;
+            });
+
+    private static final UUIDReader INSTANCE = new UUIDReader();
+
+    private UUIDReader() {}
+
+    @Override
+    public UTF8String nonNullRead(ColumnVector vector, int row) {
+      BytesColumnVector bytesVector = (BytesColumnVector) vector;

Review Comment:
   I was mainly aligning with other places in the code that also used a Thread 
local ByteBuffer when reading UUIDs, but need to double-check whether we can 
use the array directly here



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