Skip to content

Commit

Permalink
No swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astachowski committed Dec 6, 2024
1 parent 9453cf9 commit bf7baf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import org.apache.arrow.vector.complex.UnionVector;

public class EndiannessSwitchVisitor implements VectorVisitor<Void, Void> {
private static final byte[] bytes = new byte[64];

private static void flipBytes(ArrowBuf buf, int offset, int length) {
byte[] bytes = new byte[length];
buf.getBytes(offset, bytes, 0, length);
for (int i = 0; i < length / 2; i++) {
byte tmp = bytes[i];
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,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());
Expand Down

0 comments on commit bf7baf7

Please sign in to comment.