From 920c37b8f95a1090c915612cf5d1888f72ee4610 Mon Sep 17 00:00:00 2001 From: sfc-gh-astachowski Date: Fri, 6 Dec 2024 08:04:02 +0100 Subject: [PATCH] Testing with forced visitor swapping --- .../snowflake/client/jdbc/ArrowResultChunk.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java index fe32e6edd..25da08e2c 100644 --- a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java +++ b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java @@ -95,15 +95,7 @@ private void addBatchData(List batch) { */ public void readArrowStream(InputStream is) throws IOException { ArrayList valueVectors = new ArrayList<>(); - Class clazz = ArrowBuf.class; - try { - Field os = clazz.getDeclaredField("osName"); - os.setAccessible(true); - os.set(null, "aix"); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); - } - try (ArrowStreamReader reader = new ArrowStreamReader(is, rootAllocator)) { + try (ArrowStreamReader reader = new ArrowStreamReader(is, rootAllocator)) { root = reader.getVectorSchemaRoot(); while (reader.loadNextBatch()) { valueVectors = new ArrayList<>(); @@ -111,9 +103,9 @@ 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.BIG_ENDIAN)) { f.accept(new EndiannessSwitchVisitor(), null); - } + //} TransferPair t = f.getTransferPair(rootAllocator); t.transfer(); valueVectors.add(t.getTo());