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
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
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
>>> df.to_parquet("/tmp/data.parquet" )
>>> t = xorq.read_parquet("/tmp/data.parquet" )
>>> t
┏━━━━━━━┳━━━━━━━━┓
┃ a ┃ b ┃
┡━━━━━━━╇━━━━━━━━┩
│ int64 │ string │
├───────┼────────┤
│ 1 │ g │
│ 2 │ h │
│ 3 │ i │
└───────┴────────┘