Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Microsoft for Python Developers 6 min read Announcement mediumAdept

Introducing Apache Arrow Support in mssql-python

mssql-python can now fetch SQL Server result sets directly into Apache Arrow buffers, filled by a C++ fetch loop, so no Python object is created per row. Polars, Pandas (ArrowDtype) and DuckDB can then consume the data zero-copy through the Arrow C Data Interface. Three new cursor methods cover the main patterns: arrow_batch returns one RecordBatch, arrow returns a full Table (watch peak memory), and arrow_reader streams batches lazily, with batch_size trading throughput against memory. Gains are largest for temporal types like DATETIMEOFFSET, but NVARCHAR is currently slower on Linux because of the UTF-16 to UTF-8 conversion path, and a fix is planned.

Assumes: Python DB-API cursorsDataFrame libraries

Related posts

  • ClickHouse and Power BI, columnar end to end: the Arrow Flight connector is in public preview

    ClickHouse mediumAdept

    ClickHouse's new Power BI connector, now in public preview, talks Arrow Flight SQL over TLS-encrypted gRPC. Data stays columnar end to end instead of being converted to rows and back as the ODBC path does, and the Power BI service connects directly, so no on-premises gateway or driver install is needed. In a 10M-row, 20-column import benchmark, refresh took 278 s versus 390 s for ODBC plus a gateway. ClickHouse spent about 5 s on the query instead of 150 s and used roughly 6x less CPU. The connector supports query folding and exact Decimal/UInt64 types, works best in Import mode (DirectQuery is still maturing), and needs ClickHouse 26.5+ or a support request on ClickHouse Cloud.

  • Ducks in a Column

    DuckDB mediumAdept

    DuckDB stores data by column and processes it in vectors of 2,048 values, which drives its compression, projection pushdown and aggregation speed. A tour built on a duck-sightings dataset shows querying CSV, Parquet, S3 and Hive-partitioned files in place (with zonemap row-group skipping and CSV type sniffing), column-level friendly SQL (EXCLUDE, REPLACE, COLUMNS() with regex or lambdas, FROM-first, STRUCT unpacking, SUMMARIZE), and aggregation shortcuts such as GROUP BY ALL, FILTER, arg_max, PIVOT/UNPIVOT and approximate aggregates. Window functions, QUALIFY, ASOF joins for aligning mismatched time series, and list aggregation round out the examples.

  • Introducing the SQL Console on Datasets

    Hugging Face mediumAdept

    Hugging Face Hub datasets now have a one-click SQL Console that runs DuckDB WASM entirely in the browser against each dataset's Parquet files, with views created per split and config. Non-Parquet datasets have their first 5GB auto-converted. A simple filter over a 12.6M-row dataset returns in under 3 seconds, but memory is capped at roughly 3GB and DuckDB WASM lacks some DuckDB features such as the hf:// protocol. A worked example uses struct_pack to convert an Alpaca dataset into conversational format for LLM fine-tuning and exports the results to Parquet.

  • How we made querying Pandas DataFrames with chDB 87x faster

    ClickHouse mediumAdept

    chDB, the in-process embedded ClickHouse, sped up SQL queries over Pandas DataFrames 87x by replacing its original Parquet serialize/deserialize round-trip through file descriptors with a native Python table engine that reads Python objects directly. The new engine is built from a TableFunctionPython, StoragePython and PythonSource that feed ClickHouse's concurrent pipeline. To keep multi-threaded execution from serializing on the GIL and to avoid reference-counting pitfalls, the team concentrated CPython API calls before the pipeline runs, batched copies with SIMD memcpy, and reimplemented Python str encoding conversion in C++. Together these changes cut ClickBench Q23 from over 30s to 0.56s and put chDB ahead of DuckDB in the SQL-on-DataFrame benchmark. chDB v2.0.2 also adds chdb.PyReader for user-defined Python table functions, demonstrated by querying the Google Calendar API with SQL.

  • One Driver, One Format, Every Language: ADBC

    ClickHouse mediumAdept

    ClickHouse released an official ADBC (Arrow Database Connectivity) driver, written in Rust, that returns query results as Apache Arrow end to end with no row-oriented conversion or staging step. It connects over ClickHouse's HTTP interface with TLS, installs via Columnar's `dbc` package manager, and was built mainly to support dbt Fusion. It also brings ClickHouse to languages that lack an official client, such as Ruby, R and C. ADBC fits Arrow-native DataFrame workflows, AI agent pipelines and bulk ingest, while official clients remain better for full type-system coverage, async APIs and row-level or ORM work. A Ruby walkthrough builds a page-view pipeline using bulk Arrow RecordBatch ingest, a SummingMergeTree table and a materialized view.

The quest for software engineering knowledge.

Look:
Layout: