Skip to main content
Version: Python

to_arrow

to_arrow converts a Deephaven table to a PyArrow table.

Syntax

to_arrow(table: Table, cols: list[str] = None) -> pyarrow.lib.Table

Parameters

ParameterTypeDescription
tableTable

A Deephaven table.

cols optionallist[str]

The columns to convert. Default is None which means all columns.

Returns

A PyArrow table.

Examples

The following example converts a Deephaven table to a PyArrow table:

from deephaven import arrow as dhpa
from deephaven import empty_table
import pyarrow as pa

source = empty_table(10).update(["X = i", "Y = sin(X)", "Z = cos(X)"])

pa_source = dhpa.to_arrow(table=source)

The following example converts a Deephaven table to a PyArrow table, but only the X and Z columns:

from deephaven import arrow as dhpa
from deephaven import empty_table
import pyarrow as pa

source = empty_table(10).update(["X = i", "Y = sin(X)", "Z = cos(X)"])

pa_source = dhpa.to_arrow(table=source, cols=["X", "Z"])