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

Function test_jvm_string_array

python/pyarrow/tests/test_jvm.py:421–435  ·  view source on GitHub ↗
(root_allocator)

Source from the content-addressed store, hash-verified

419@pytest.mark.xfail(reason="from_buffers is only supported for "
420 "primitive arrays yet")
421def test_jvm_string_array(root_allocator):
422 data = ["string", None, "töst"]
423 cls = "org.apache.arrow.vector.VarCharVector"
424 jvm_vector = jpype.JClass(cls)("vector", root_allocator)
425 jvm_vector.allocateNew()
426
427 for i, string in enumerate(data):
428 holder = _string_to_varchar_holder(root_allocator, "string")
429 jvm_vector.setSafe(i, holder)
430 jvm_vector.setValueCount(i + 1)
431
432 py_array = pa.array(data, type=pa.string())
433 jvm_array = pa_jvm.array(jvm_vector)
434
435 assert py_array.equals(jvm_array)

Callers

nothing calls this directly

Calls 4

equalsMethod · 0.80
arrayMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected