MCPcopy Create free account
hub / github.com/apache/arrow / record_batch

Function record_batch

python/pyarrow/jvm.py:313–335  ·  view source on GitHub ↗

Construct a (Python) RecordBatch from a JVM VectorSchemaRoot Parameters ---------- jvm_vector_schema_root : org.apache.arrow.vector.VectorSchemaRoot Returns ------- record_batch: pyarrow.RecordBatch

(jvm_vector_schema_root)

Source from the content-addressed store, hash-verified

311
312
313def record_batch(jvm_vector_schema_root):
314 """
315 Construct a (Python) RecordBatch from a JVM VectorSchemaRoot
316
317 Parameters
318 ----------
319 jvm_vector_schema_root : org.apache.arrow.vector.VectorSchemaRoot
320
321 Returns
322 -------
323 record_batch: pyarrow.RecordBatch
324 """
325 pa_schema = schema(jvm_vector_schema_root.getSchema())
326
327 arrays = []
328 for name in pa_schema.names:
329 arrays.append(array(jvm_vector_schema_root.getVector(name)))
330
331 return pa.RecordBatch.from_arrays(
332 arrays,
333 pa_schema.names,
334 metadata=pa_schema.metadata
335 )

Callers 2

device_typesMethod · 0.85
ToStringMethod · 0.85

Calls 4

arrayFunction · 0.85
schemaFunction · 0.70
getSchemaMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected