Skip to main content

Fast queries on Parquet data in Rust

Several projects in banking and consumer products have made use of data stored in data lakes in Parquet, a compact and efficient column-oriented format. Python with Pandas is a feasible but very inefficient choice for this, and I have typically used Spark here. Recently revisting Rust for long-lived MCP servers, I have been exploring DataFusion for direct queries on Parquet data from Rust, and am very impressed.

DataFusion describes itself as an extensible query engine written in Rust that uses Apache Arrow as its in-memory format. The web site explains that Out of the box, DataFusion offers SQL and Dataframe APIs, excellent performance, built-in support for CSV, Parquet, JSON, and Avro, extensive customization, and a great community. It is basically a library to access these data formats and query them, either via chained declarative function calls, or via strings with SQL queries.

Revisiting Prolog for AI

I first got into AI in the late 1980s while at Air Canada. At that time, AI research and applications were dominated by the languages LISP and Prolog. I experimented with both, and was fascinated with Prolog’s ability to solve problems that you defined as facts, and rules. During a recent visit to Bletchley Park north of London, I reflected on how this ability could have helped the tedious code-breaking efforts there, had it been available, and picked up a book of logic puzzles in the shop, with the intent of solving them using AI and Prolog.

Books for understanding AI

Last week, I had the pleasure of presenting a keynote at the AI Consulting Conference 2026 in Munich, although I had to connect virtually from London due to other commitments. My key point is that AI is eating away at a lot of the magic powers that consultants used to wield, and that to stay relevant, you need to identify the gaps between what AI can do, and where experts are still needed. This is a moving target, and you need to understand something about how AI works to see where the gaps are.

Comparing speed of some fast languages

To get more familiar with Rust, I’ve lately been revisting last year’s Advent of Code problems, which I did in Go last December. My Go solution solution for Day 5 uses brute-force and is not very clever, but runs fast enough in Go (under 6 minutes). The Rust equivalent runs in 1/3 less time, and I was wondering how other languages would fare. The results might surprise you.

I ended up writing the solution in Rust, Zig, and C, in addition to the original Go solution.

Looking at Zig

I finally took some time this weekend to look at Zig, and I am very impressed. It’s a fairly low-level language, but could be appropriate for some performance-critical data science use cases. Based on an initial test, it is twice as fast as Rust, which is about 50% faster than Go. And it appears to be faster than C, which I find puzzling.

To explore the language, I rewrote a naive and computationally intensive brute-force solution to day 5 of last year’s Advent of Code. My non-sophisticated solution took 5:40 in Go for both parts, fast enough that I didn’t bother finding a more streamlined solution (which would have been necessary in Python). For comparison, I also rewrote the same solution in Rust and C.