vibhatha commented on code in PR #41967:
URL: https://github.com/apache/arrow/pull/41967#discussion_r1632576374
##########
java/c/src/main/java/org/apache/arrow/c/ArrayExporter.java:
##########
@@ -96,8 +97,34 @@ void export(ArrowArray array, FieldVector vector,
DictionaryProvider dictionaryP
}
if (buffers != null) {
+ final long bufferSize = buffers.size();
+ /*
+ * For Variadic types, an additional buffer is kept to store
+ * the size of each variadic buffer since that information
+ * cannot be retrieved in the import component.
+ * Here, the dataBufferReqCount is calculated to determine
+ * the additional number of buffers required.
+ * Also note that if the bufferSize is greater than 2, it means
+ * there is one or more data buffers.
+ * Thus, the dataBufferReqCount is set to 1 to get additional buffer
+ * for to store variadic size buffer.
+ * If it is not the case, the dataBuffer is not present.
+ * According to the spec and C Data interface in C++, there must be
+ * at least 3 data buffers present at the import component.
+ * Thus, the dataBufferReqCount is set to 2 to get additional buffer
+ * for empty dataBuffer and the variadic size buffer.
+ */
+ int dataBufferReqCount = 0;
+ if (vector instanceof BaseVariableWidthViewVector) {
Review Comment:
Yes I mean we can pass that to the export as a variable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]