How Apache DataFusion Runs SQL In-Process
Apache DataFusion is an embeddable query engine: SQL goes in, runs as columnar Arrow batches inside your own process, and results come out without a separate service.
Loading…
Topic
54 posts about SQL. Every summary links to the original.
See the idea
Apache DataFusion is an embeddable query engine: SQL goes in, runs as columnar Arrow batches inside your own process, and results come out without a separate service.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
On November 13, 2026, an FAA outage grounded air traffic across the United States. The post visualizes the entire day over the lower 48 states using ADS-B data from adsb.exposed, which stores 380 billion position reports in a ClickHouse table sorted by a Z-order curve. The animation is rendered entirely by ClickHouse’s built-in FORMAT PNG output format, with no external plotting library or image-processing script. A SQL query aggregates positions by pixel and 5-minute frame, then returns rows that become the map, title, clock, timeline, and aircraft streaks colored by altitude and speed. The resulting animated PNG is 150 MB, reduced to 25 MB with a 256-color palette, and is also available as a GIF and MP4.
Front migrated from Elasticsearch to ClickHouse Cloud to power customer-facing analytics across tens of millions of messages per day for over 9,000 B2B companies. With Elasticsearch, adding a single new metric took a senior engineer several weeks due to the complexity of Painless scripting. In ClickHouse, a junior engineer implemented the first metric in three days using a single framework that defines each metric once and automatically generates all visualizations. For one enterprise customer, a 30-second query that returned 11 days of data in Elasticsearch now returns 1.5 months of data in ClickHouse with half the machines. The team used ClickHouse’s VersionedCollapsingMergeTree engine to maintain pixel-perfect accuracy with mutable data such as deleted messages or merged threads.
Databricks has made Genie Migrate for Lakehouse generally available, an AI coding agent that automates migrations from legacy data warehouses to the Databricks Lakehouse. The tool supports converting SQL code from seven sources—Microsoft SQL Server, Azure Synapse, Teradata, Oracle, Snowflake, Amazon Redshift, and Google BigQuery—to open ANSI SQL. Genie Migrate organizes work in a migration project, reviews file lineage, converts files in parallel, and lets engineers compare original and converted code side by side. It achieves over 90% conversion accuracy on benchmarks by using built-in dialect knowledge, a check-and-revise loop, and custom skills for team standards. Databricks reports that the median migration time has dropped by 25% over the past six months as teams use AI in their migration work.
ClickHouse argues that traditional observability UIs cannot satisfy every team’s unique workflows, leading many large companies to build their own. To address this, they introduce ClickHouse Observability Apps, which let users generate custom investigation experiences by describing an application in natural language. An agent builds the app with custom views, navigation, and live data, which users can refine through conversation and share with their team. The approach relies on SQL for flexible analysis, allowing queries that go beyond fixed endpoints, such as calculating processor baselines or linking payment attempts to orders. The feature is in private preview, with ongoing work on evaluation alignment, prompt injection robustness, and reusable components.
ClickHouse announced ClickHouse Observability, a fully managed observability solution in public beta, powered by ClickHouse Cloud and open-source ClickStack. The service provides a managed OTLP endpoint for OpenTelemetry data, handling ingestion, schemas, and storage automatically. Users can investigate logs, metrics, and traces through the ClickStack UI, MCP tools, or SQL without managing database infrastructure. Pricing is volume-based at $0.20 per GB for logs and traces and $0.10 per million data points for metrics, with a 50% discount during public beta. Additionally, ClickHouse Observability Apps, in private preview, allows users to describe a custom investigation UI and have an agent generate queries and visualizations without writing code.
ClickHouse 26.10 introduces a function composition operator (|) that chains functions into a pipeline, making lambdas in higher-order functions like arrayMap more readable. The release adds a written_rows counter to quotas, allowing administrators to cap ingestion by the number of rows a user writes per interval. New Array and Map functions expand the library for working with collections. String filtering during scan checks LIKE, startsWith, and endsWith while deserializing a column, reducing peak memory by about 98% in tests without affecting execution time. An experimental columns cache avoids repeated decompression and deserialization of the same data, and disk spilling for IN subqueries is now supported.
Apache Spark 4.3 introduces stateful processing in Real-Time Mode, achieving sub-150 ms P99 end-to-end latency for streaming aggregation, deduplication, and custom stateful processing using transformWithState. This eliminates the need for a separate streaming engine for millisecond-scale latency in fraud detection, user activity monitoring, and device monitoring, enabled by native concurrent stage scheduling and pipelined shuffles. The release also includes Project Feather for faster iteration on small data by reducing execution overhead, and SCD Type 2 Auto CDC for tracking record changes over time. SQL enhancements include JSON_TABLE, VARIANT transformations, ASOF JOIN for temporal matching, and a nanosecond timestamp preview. Spark 4.3 marks a shift to quarterly feature releases, with over 200 contributors addressing more than 1,100 Jira tickets, and is now available in Databricks Runtime 19.
Databricks now supports UNIQUE constraints in Public Preview for Unity Catalog Delta tables, allowing tables to declare multiple uniqueness guarantees beyond a single primary key. Unlike primary keys, UNIQUE constraints can be nullable and multiple can exist per table, enabling schemas to record business-level uniqueness such as username or composite (workspace_id, external_user_id). These constraints are informational by default and not enforced on writes, but after validation they can be marked with RELY to enable query optimizations. With RELY, the optimizer can eliminate unnecessary joins and DISTINCT aggregations, achieving up to 7.9x and 12.0x speedups respectively on TPC-DS SF10000 benchmarks by removing over 99.99% of shuffle. Foreign keys can also reference UNIQUE constraints, and the feature supports composite and nullable unique columns with specific nullability considerations for optimization, and the post provides validation queries to check data before enabling RELY.
Explorer is a new query editor in the Supabase Dashboard that unifies database and log queries into one interface, solving the common problem of diagnosing production issues across separate tools and keeping investigations in one place. Notebooks combine saved queries with markdown notes, storing queries rather than results so rerunning always returns current data, making investigations reproducible and shareable instead of being lost in Slack snippets. Users write SQL against either source and render results as tables or charts, and the Assistant can write queries from plain language while keeping the SQL visible and editable, with every change awaiting approval. Log queries carry their own time range, and notebooks live in the supabase folder for versioning and pull request review, with CLI commands supabase notebooks pull and push. Explorer is in feature preview, enabled under Feature Previews in the Dashboard, with notebooks commands available in the beta CLI.
Financial institutions keep sensitive portfolio data, trading positions, and client information in on-premises databases like SQL Server, while third-party market data such as FactSet analyst estimates and financial fundamentals lives in the cloud. Traditional approaches require copying data or building brittle ETL pipelines, introducing cost, risk, and compliance burden. Databricks Lakehouse Federation solves this by letting users create federated connections to external databases and query them directly with standard SQL without moving the data. In a wealth management walkthrough, users combine a federated on-premises holdings catalog with FactSet data subscribed through the Databricks Marketplace in a single Unity Catalog SQL query. This query powers interactive dashboards and Genie natural-language queries, eliminating materialized views, pipelines, and any need to persist intermediate objects while keeping sensitive data on-premises.
ClickHouse added five models to its Agentic Analytics Benchmark—GPT-6 Astra, Luna, Sol, Claude Opus 5.5, and Claude Sonnet 5.5—using the same 201 analytics questions, synthetic warehouse, and judge panel. All five scored between 68.7% and 69.7%, statistically tied and mid-board, while Claude Fable 5.1 retains the top spot at 76.6%. Claude Sonnet 5.5 delivered the largest improvement, raising accuracy from 62.2% to 68.7% and eliminating budget-limit failures while reducing median turns from 9.1 to 3.5 and cost to about five cents per question. The gain concentrated on the 83 questions requiring the dimensional CRM layer, where Sonnet 5.5 scored 73.5% versus 62.7% for Sonnet 5, and the harness was updated with engine pinning and credential preflight. Contamination probes found no memorization of anonymized entity names, and the board now ranks 34 models with a frozen question set.
Tens of thousands of organizations use dbt, and where it runs directly affects pipeline cost, speed, and operational complexity. Running dbt on Databricks provides an open, unified platform, yet many teams underutilize its capabilities. The post details practices to reduce costs, such as applying appropriate incremental strategies and replacing full recomputes with materialized views, which delivered a 17x speedup in a benchmark. It also covers automating data layout with Liquid Clustering and Predictive Optimization, and attributing every dollar to specific models via query tags. For operational simplicity, it recommends bringing ingestion into dbt with streaming tables, standardizing metrics through Unity Catalog Semantics, and orchestrating pipelines natively with Lakeflow Jobs.
Data teams frequently field questions about future sales, metric movements, and anomalous data, but answering them typically requires data science teams to build and manage models, creating a bottleneck. Predictive AI Functions, now in Beta, remove that bottleneck by providing SQL-native functions for forecasting, driver analysis, and anomaly detection, backed by state-of-the-art ML models maintained centrally by Databricks. The launch includes ai_forecast for time series projection, ai_top_drivers for segment driver analysis, ai_detect_anomalies for outlier detection, and ai_predict_value and ai_predict_class for regression and classification. These functions can be called directly in SQL, invoked through Genie with plain-language questions, or embedded in dashboards, delivering consistent, high-quality answers without infrastructure management. Benchmarking on fev-bench shows ai_forecast outperforms forecasting functions from leading cloud data warehouses, achieving industry-leading accuracy out of the box with no tuning required.
Cloudflare Logpush now supports Transformers, allowing teams to filter, redact, and reshape log streams using SQL before export to SIEMs, analytics platforms, or object storage. This eliminates the need for a separate processing service that teams would otherwise have to deploy, scale, and maintain. Transformers are SQL queries applied per batch within Logpush’s high-throughput pipeline, using Apache DataFusion and Arrow for columnar execution. The implementation embeds DataFusion in Bufstream, the Go-based delivery service, using cgo and Arrow IPC to pass typed batches across the language boundary without introducing network hops. Customers can create, preview, and version Transformers via the dashboard or API, and attach them to NDJSON Logpush jobs to reduce downstream data volume and cost.
Reactive cost management for cloud data warehouses fails because usage is unattributed, budgets are absent, and alerts arrive too late. Databricks’ proactive framework addresses this through five pillars: cost attribution via warehouse and query tags, layered budgets with email alerts, real-time dashboards, and optimizations. SQL Serverless warehouses eliminate idle compute costs, as Lumen Technologies demonstrated with a 30-40% reduction. Query tags (Public Preview) enable per-query attribution, linking spend to specific dashboards or dbt models. The post provides step-by-step instructions for tagging, budget creation in the Account Console, and tuning auto-stop and statement timeouts to reduce waste.
Repointing a dbt project to Databricks involves swapping the adapter and profile, handling SQL dialect differences, and keeping transformation logic unchanged. The dbt-databricks adapter bridges the project to Databricks Lakehouse, which uses a three-level namespace (catalog.schema.table) and supports open formats like Delta Lake and Apache Iceberg. Common dialect gaps include REGEXP_SUBSTR, DIV0, and OBJECT_CONSTRUCT, which can be fixed with Databricks-native functions or dbt_utils macros; the post walks through each error and its fix. After compilation and validation using audit-helper to compare outputs model by model, the project can be deployed as a dbt task in Lakeflow Jobs with built-in governance via Unity Catalog. The process is incremental: one-time setup costs apply, then each additional model requires only dialect fixes, making it a low-risk starting point for warehouse migration.
The data warehouse served structured SQL workloads for two decades, but the lakehouse now supports BI, data engineering, ML, streaming, and AI agents from a single governed platform. Databricks reports a 77% improvement in its production SQL workload mix since 2022, with customer migrations showing 90% faster queries (Lumen) and 80-90% faster analytics (Trek Bicycle). Lakehouse//RT delivers sub-second analytical queries at high concurrency directly on governed lakehouse tables, with Databricks reporting sub-100-ms latency at 12,000 queries per second, collapsing the traditional architecture of separate serving databases. The lakehouse eliminates data copying between systems, handles unstructured data, and runs on open formats like Delta Lake and Apache Iceberg, governed by Unity Catalog. Customer cost reductions range from 25% to 75%, with AXA Japan reducing warehouse costs by 60% and ETL costs by 70%, driven by eliminating redundant systems and data copies.
The 2026 Developer Survey gathered responses from over 30,000 developers over seven weeks, covering work patterns, technology usage, and AI adoption. Only 18% of developers work in an office daily, and the share of solo developers rose from 4% to 10%, possibly reflecting AI-enabled solopreneurship. In technology rankings, SQL surpassed HTML/CSS for the second spot, while Rust climbed to 12th most used language, potentially influenced by memory safety advocacy. AI usage is widespread: 73% of AI tool users employ them daily, with Claude Code (66%) and GitHub Copilot (59%) as leading agents, primarily for code generation (67%) and debugging (61%). Developers prioritize quality over cost (75% vs 38%) when using AI, and organizations implement cost controls like usage limits (38%) and model routing (27%), though 21% report increased spending.
Batch vector search workloads, such as entity resolution and semantic tagging, require high throughput across millions of queries against billions of vectors, unlike real-time serving. Databricks built NEAREST BY, a first-class top-k ranking join syntax, directly into its runtime engine rather than federating to an external endpoint. The feature is implemented as a logical join that the optimizer lowers onto standard relational operators, enabling fault tolerance and elastic parallelism. A fused Photon operator collapses the plan’s middle section with a blocked GEMM kernel designed to approach peak arithmetic intensity for vector scoring. An optional IVF index, stored as an ordinary liquid-clustered Delta table, allows approximate queries to probe only relevant clusters while preserving the same primitives and correctness guarantees.
Cloudflare announced eight major updates unifying logs, traces, analytics, alerts, dashboards, and data export into one observability platform with simplified pricing. The new Logs home combines Workers Observability and Log Explorer, letting users query datasets like HTTP events, firewall events, Workers, and R2 using SQL or filters. Cloudflare Traces, now in open beta, provides request-level visibility across security rules, transformations, caching, routing, Workers, and origin, with OpenTelemetry export and W3C trace context propagation. A unified SQL API lets humans and agents query telemetry across Cloudflare products, and custom alerts can be set on any dataset using threshold, anomaly, or SLO conditions. Pricing shifts to a volume-based model for ingested and stored logs and traces, effective December 1, 2026, with free tier at 0.5 GB ingestion per day and paid plans starting at 50 GB ingestion per billing cycle.
The best engineering reads, once a week.