>>> import xorq.api as xo
>>> import pandas as pd
>>> xo.options.interactive = True
>>> df = pd.DataFrame({"a": [1, 2, 3], "b": list("ghi")})
>>> dfread_parquet
xorq.api.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
>>> df.to_parquet("/tmp/data.parquet")
>>> t = xo.read_parquet("/tmp/data.parquet")
>>> t