read_parquet

xorq.read_parquet(sources, table_name=None, **kwargs)

Lazily load a parquet file or set of parquet files.

This function delegates to the read_parquet method on the current default backend (DuckDB or ibis.config.default_backend).

Parameters

Name Type Description Default
sources str | Path | Sequence[str | Path] A filesystem path or URL or list of same. required
table_name str | None A name to refer to the table. If not provided, a name will be generated. None
kwargs Any Backend-specific keyword arguments for the file type. For the DuckDB backend used by default, please refer to: * Parquet: https://duckdb.org/docs/data/parquet {}

Returns

Name Type Description
ir.Table Table expression representing a file

Examples

>>> import xorq
>>> import pandas as pd
>>> xorq.options.interactive = True
>>> df = pd.DataFrame({"a": [1, 2, 3], "b": list("ghi")})
>>> df
a b
0 1 g
1 2 h
2 3 i
>>> df.to_parquet("/tmp/data.parquet")
>>> t = xorq.read_parquet("/tmp/data.parquet")
>>> t
┏━━━━━━━┳━━━━━━━━┓
┃ a      b      ┃
┡━━━━━━━╇━━━━━━━━┩
│ int64string │
├───────┼────────┤
│     1g      │
│     2h      │
│     3i      │
└───────┴────────┘