arrow-odbc is a Python library that enables efficient reading of data from any ODBC data source directly into Apache Arrow record batches. Built with Rust, it provides a high-performance bridge between relational databases accessible via ODBC and Python's data analysis ecosystem. As of version 10.1.0, it offers robust capabilities for data ingestion into Arrow, supporting various data types and large datasets. It generally follows a regular release cadence, with major versions often introducing significant features or breaking changes.
pip install arrow-odbcVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to an ODBC data source and retrieve data as an Apache Arrow Table using `arrow-odbc`. It highlights the `read_arrow_tables` function, which is the primary entry point for data retrieval. Users must replace the example connection string and query with their specific database details and ensure the appropriate ODBC driver is installed on their system.
Update calls from `read_all_tables(...)` to `read_arrow_tables(...)`.
Consult your database vendor's documentation for instructions on installing and configuring the necessary ODBC driver (e.g., `unixodbc-dev` and `msodbcsql17` for SQL Server on Linux).
Verify the connection string format against your specific ODBC driver's documentation and database requirements. Pay close attention to driver name, server address, database name, and credentials.
For very large datasets, consider fetching data in smaller chunks using `LIMIT`/`OFFSET` in your SQL query, or leverage the `chunk_size_in_rows` and `max_chunks_in_flight` parameters in `read_arrow_tables` if available (check current documentation for `arrow-odbc`'s support for these). Alternatively, process the Arrow Table iteratively or save it to disk directly (e.g., Parquet).