Python 3.8+ on macOS and Linux (x86_64 and ARM64)
Install UsageCLI example:
Python file example:
Queries can return data using any supported format as well as Dataframe
and Debug
.
You can find the GitHub repository for the project at chdb-io/chdb.
Data InputThe following methods are available to access on-disk and in-memory data formats:
Query On File (Parquet, CSV, JSON, Arrow, ORC and 60+)You can execute SQL and return desired format data.
Work with Parquet or CSV
Pandas DataFrame output
Query on table (Pandas DataFrame, Parquet file/bytes, Arrow bytes)Query On Pandas DataFrame
Query with stateful sessionSessions will keep the state of query. All DDL and DML state will be kept in a directory. Directory path can be passed in as an argument. If it is not passed, a temporary directory will be created.
If the path is not specified, the temporary directory will be deleted when the Session object is deleted. Otherwise, the path will be kept.
Note that the default database is _local
and the default engine is Memory
which means all data will be stored in memory. If you want to store data in disk, you should create another database.
See also: test_stateful.py.
Query with Python DB-API 2.0 Query with UDF (User Defined Functions)Some notes on the chDB Python UDF (User Defined Function) decorator.
sys.executable
.see also: test_udf.py.
Python table engine Query on Pandas DataFrame Query on Arrow Table Query on chdb.PyReader class instanceread
method.read
method should:
col_names
of read
.read
method.get_schema
method can be implemented to return the schema of the table. The prototype is def get_schema(self) -> List[Tuple[str, str]]:
, the return value is a list of tuples, each tuple contains the column name and the column type. The column type should be one of the following.See also: test_query_py.py.
Limitationspandas.Series
, pyarrow.array
,chdb.PyReader
For more examples, see examples and tests.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4