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

Function jvm_buffer

python/pyarrow/jvm.py:51–69  ·  view source on GitHub ↗

Construct an Arrow buffer from org.apache.arrow.memory.ArrowBuf Parameters ---------- jvm_buf: org.apache.arrow.memory.ArrowBuf Arrow Buffer representation on the JVM. Returns ------- pyarrow.Buffer Python Buffer that references the JVM memory.

(jvm_buf)

Source from the content-addressed store, hash-verified

49
50
51def jvm_buffer(jvm_buf):
52 """
53 Construct an Arrow buffer from org.apache.arrow.memory.ArrowBuf
54
55 Parameters
56 ----------
57
58 jvm_buf: org.apache.arrow.memory.ArrowBuf
59 Arrow Buffer representation on the JVM.
60
61 Returns
62 -------
63 pyarrow.Buffer
64 Python Buffer that references the JVM memory.
65 """
66 nanny = _JvmBufferNanny(jvm_buf)
67 address = jvm_buf.memoryAddress()
68 size = jvm_buf.capacity()
69 return pa.foreign_buffer(address, size, base=nanny)
70
71
72def _from_jvm_int_type(jvm_type):

Callers 1

arrayFunction · 0.85

Calls 2

_JvmBufferNannyClass · 0.85
capacityMethod · 0.45

Tested by

no test coverage detected