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

Function make_table

python/pyarrow/tests/test_cuda.py:731–756  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

729
730
731def make_table():
732 a0 = pa.array([0, 1, 42, None], type=pa.int16())
733 a1 = pa.array([[0, 1], [2], [], None], type=pa.list_(pa.int32()))
734 a2 = pa.array([("ab", True), ("cde", False), (None, None), None],
735 type=pa.struct([("strs", pa.utf8()),
736 ("bools", pa.bool_())]))
737 # Dictionaries are validated on the IPC read path, but that can produce
738 # issues for GPU-located dictionaries. Check that they work fine.
739 a3 = pa.DictionaryArray.from_arrays(
740 indices=[0, 1, 1, None],
741 dictionary=pa.array(['foo', 'bar']))
742 a4 = pa.DictionaryArray.from_arrays(
743 indices=[2, 1, 2, None],
744 dictionary=a1)
745 a5 = pa.DictionaryArray.from_arrays(
746 indices=[2, 1, 0, None],
747 dictionary=a2)
748
749 arrays = [a0, a1, a2, a3, a4, a5]
750 schema = pa.schema([
751 (f'f{i}', arr.type)
752 for i, arr in enumerate(arrays)
753 ])
754 batch = pa.record_batch(arrays, schema=schema)
755 table = pa.Table.from_batches([batch])
756 return table
757
758
759def make_table_cuda():

Callers 1

make_table_cudaFunction · 0.85

Calls 2

arrayMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected