Skip to content

Commit

Permalink
fix: temp
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed Aug 1, 2024
1 parent 2419c34 commit d54ba23
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.arrow.util.AutoCloseables;
import org.apache.arrow.util.VisibleForTesting;
import org.apache.arrow.vector.BaseVariableWidthViewVector;
import org.apache.arrow.vector.BitVectorHelper;
import org.apache.arrow.vector.DateDayVector;
import org.apache.arrow.vector.DateMilliVector;
import org.apache.arrow.vector.DurationVector;
Expand Down Expand Up @@ -118,10 +119,10 @@ private ArrowBuf importFixedBitsWithOffset(ArrowType type, int index, long bitsP
// Calculate the total capacity needed, including the offset
final long totalSlots = arrowArrayOffset + fieldNode.getLength();
final long totalBits = totalSlots * bitsPerSlot;
// final long capacity = DataSizeRoundingUtil.divideBy8Ceil(totalBits);
final long capacity = DataSizeRoundingUtil.divideBy8Ceil(totalBits);

// Import the buffer with the calculated capacity
ArrowBuf buf = importBuffer(type, index, totalBits);
ArrowBuf buf = importBuffer(type, index, capacity);

// Calculate the start and end positions in bits
final long startBit = arrowArrayOffset * bitsPerSlot;
Expand All @@ -134,7 +135,17 @@ private ArrowBuf importFixedBitsWithOffset(ArrowType type, int index, long bitsP

if (startByte != endByte) {
return buf.slice(startByte, endByte - startByte);
}
} // else {
// final ArrowBuf bufCopy = allocator.buffer(buf.capacity());
// bufCopy.setZero(0, buf.capacity());
//
// for (int i = (int) arrowArrayOffset; i < bufCopy.capacity(); i++) {
// if (BitVectorHelper.get(buf, i) == 1) {
// BitVectorHelper.setBit(buf, i);
// }
// }
// return bufCopy;
// }
return buf;
}

Expand Down

0 comments on commit d54ba23

Please sign in to comment.