Skip to content

Commit

Permalink
fix: adding issues for future work
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed Apr 2, 2024
1 parent c387b40 commit 184ed70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ public String getName() {
* the top class as of now is not a good idea.
*/

/* TODO:
* Implement TransferPair functionality
* https://github.com/apache/arrow/issues/40932
*
*/

/**
* Get buffer that manages the validity (NULL or NON-NULL nature) of
* elements in the vector. Consider it as a buffer for internal bit vector
Expand Down Expand Up @@ -346,19 +352,8 @@ public List<FieldVector> getChildrenFromFields() {
*/
@Override
public void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers) {
ArrowBuf bitBuffer = ownBuffers.get(0);
ArrowBuf offBuffer = ownBuffers.get(1);
ArrowBuf dataBuffer = ownBuffers.get(2);

validityBuffer.getReferenceManager().release();
validityBuffer = BitVectorHelper.loadValidityBuffer(fieldNode, bitBuffer, allocator);
offsetBuffer.getReferenceManager().release();
offsetBuffer = offBuffer.getReferenceManager().retain(offBuffer, allocator);
valueBuffer.getReferenceManager().release();
valueBuffer = dataBuffer.getReferenceManager().retain(dataBuffer, allocator);

lastSet = fieldNode.getLength() - 1;
valueCount = fieldNode.getLength();
// TODO: https://github.com/apache/arrow/issues/40931
throw new UnsupportedOperationException("loadFieldBuffers is not supported for BaseVariableWidthViewVector");
}

/**
Expand All @@ -378,6 +373,8 @@ public List<ArrowBuf> getFieldBuffers() {
result.add(validityBuffer);
result.add(offsetBuffer);
result.add(valueBuffer);
// append data buffers
result.addAll(dataBuffers);

return result;
}
Expand Down Expand Up @@ -713,7 +710,8 @@ public Field getField() {
* Note: This method only returns validityBuffer, offsetBuffer and valueBuffer.
* But it doesn't return the reference buffers.
* <p>
* TODO: Introduce a separate method to get the reference buffers.
* TODO: Implement a strategy to retrieve the reference buffers.
* <a href="https://github.com/apache/arrow/issues/40930">Reference buffer retrieval.</a>
*
* @param clear Whether to clear vector before returning, the buffers will still be refcounted
* but the returned array will be the only reference to them
Expand Down Expand Up @@ -1420,6 +1418,8 @@ public static ArrowBuf set(ArrowBuf buffer, BufferAllocator allocator,
/**
* Copy a cell value from a particular index in source vector to a particular position in this
* vector.
* TODO: Improve functionality to support copying views.
* <a href="https://github.com/apache/arrow/issues/40933">Enhance CopyFrom</a>
*
* @param fromIndex position to copy from in source vector
* @param thisIndex position to copy to in this vector
Expand Down Expand Up @@ -1449,7 +1449,8 @@ public void copyFrom(int fromIndex, int thisIndex, ValueVector from) {
/**
* Same as {@link #copyFrom(int, int, ValueVector)} except that it handles the case when the
* capacity of the vector needs to be expanded before copy.
*
* TODO: Improve functionality to support copying views.
* <a href="https://github.com/apache/arrow/issues/40933">Enhance CopyFrom</a>
* @param fromIndex position to copy from in source vector
* @param thisIndex position to copy to in this vector
* @param from source vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public TypeLayout visit(Binary type) {

@Override
public TypeLayout visit(ArrowType.BinaryView type) {
// TODO: https://github.com/apache/arrow/issues/40934
throw new UnsupportedOperationException("BinaryView not supported");
}

Expand All @@ -186,6 +187,7 @@ public TypeLayout visit(Utf8 type) {

@Override
public TypeLayout visit(Utf8View type) {
// TODO: https://github.com/apache/arrow/issues/40934
throw new UnsupportedOperationException("Utf8View not supported");
}

Expand Down Expand Up @@ -360,7 +362,7 @@ public Integer visit(Binary type) {

@Override
public Integer visit(ArrowType.BinaryView type) {
// TODO: fix this to match views
// TODO: https://github.com/apache/arrow/issues/40935
return VARIABLE_WIDTH_BUFFER_COUNT;
}

Expand All @@ -371,7 +373,7 @@ public Integer visit(Utf8 type) {

@Override
public Integer visit(Utf8View type) {
// TODO: fix this to match views
// TODO: https://github.com/apache/arrow/issues/40935
return VARIABLE_WIDTH_BUFFER_COUNT;
}

Expand Down

0 comments on commit 184ed70

Please sign in to comment.