Skip to content

Commit 9d9777e

Browse files
committed
Add ArrowRecordBatch constructor with customMetadata and without retainBuffers to replicate existing API
1 parent 2cb1d5e commit 9d9777e

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

vector/src/main/java/org/apache/arrow/vector/ipc/message/ArrowRecordBatch.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,36 @@ public ArrowRecordBatch(
160160
true);
161161
}
162162

163+
/**
164+
* Construct a record batch from nodes.
165+
*
166+
* @param length how many rows in this batch
167+
* @param nodes field level info
168+
* @param buffers will be retained until this recordBatch is closed
169+
* @param bodyCompression compression info.
170+
* @param variadicBufferCounts the number of buffers in each variadic section.
171+
* @param alignBuffers Whether to align buffers to an 8 byte boundary.
172+
* @param customMetadata custom metadata for this record batch.
173+
*/
174+
public ArrowRecordBatch(
175+
int length,
176+
List<ArrowFieldNode> nodes,
177+
List<ArrowBuf> buffers,
178+
ArrowBodyCompression bodyCompression,
179+
List<Long> variadicBufferCounts,
180+
boolean alignBuffers,
181+
Map<String, String> customMetadata) {
182+
this(
183+
length,
184+
nodes,
185+
buffers,
186+
bodyCompression,
187+
variadicBufferCounts,
188+
alignBuffers, /*retainBuffers*/
189+
true,
190+
customMetadata);
191+
}
192+
163193
/**
164194
* Construct a record batch from nodes.
165195
*

vector/src/main/java/org/apache/arrow/vector/ipc/message/MessageSerializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ public static ArrowRecordBatch deserializeRecordBatch(
477477
bodyCompression,
478478
variadicBufferCounts,
479479
/*alignBuffers*/ true,
480-
/*retainBuffers*/ true,
481480
customMetadata);
482481
body.getReferenceManager().release();
483482
return arrowRecordBatch;

0 commit comments

Comments
 (0)