From 5e4bd5abbde6268d404097c996de3d10adbac324 Mon Sep 17 00:00:00 2001 From: sfc-gh-astachowski Date: Thu, 5 Dec 2024 16:29:59 +0100 Subject: [PATCH] Double swapping on little endian systems for performance testing --- src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java index 27028bdd7..c79d34160 100644 --- a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java +++ b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java @@ -101,9 +101,10 @@ public void readArrowStream(InputStream is) throws IOException { for (FieldVector f : root.getFieldVectors()) { // transfer will not copy data but transfer ownership of memory // from streamReader to resultChunk - if(ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { + if(ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { f.accept(new EndiannessSwitchVisitor(), null); } + f.accept(new EndiannessSwitchVisitor(), null); TransferPair t = f.getTransferPair(rootAllocator); t.transfer(); valueVectors.add(t.getTo());