Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

Sort In Place, or Merge? How DataFusion Decides Between One Big Sort and a Fan-In of Sorted Runs

Oct 21, 2026 7 min read Jay Hubbert

DataFusion’s external sorter has two modes: sort the whole buffered input in one concatenated batch when it is small, and otherwise sort per-batch runs and merge them — coalescing …

DatafusionSortingPerformanceInternalsMemory

Read more →

DataFusion's Constant Folding Trick: Evaluate the Expression Against a Dummy Row of NULLs

Oct 21, 2026 10 min read Jay Hubbert

DataFusion constant-folds expressions by running them against a one-row dummy batch of NULLs, and guards the trick with checks for volatility, leaf nodes, and regexes that would …

DatafusionOptimizerConstant foldingPerformanceInternals

Read more →

Top-K without a sort: how DataFusion keeps a bounded heap of the k smallest rows

Oct 21, 2026 17 min read Jay Hubbert

Instead of sorting N rows to keep k, DataFusion encodes sort keys in Arrow’s row format, keeps the k best rows in a binary heap, and publishes a dynamic filter so the scan below …

DatafusionExecutionPerformanceInternals

Read more →

DataFusion's DISTINCT Is a GROUP BY, and approx_distinct Is a HyperLogLog Over Hashes

Oct 21, 2026 20 min read Jay Hubbert

Exact DISTINCT becomes a GROUP BY on every column, and the approximate version keeps a 16 KiB HyperLogLog sketch per group, keyed by the hash of the value rather than the value …

DatafusionAggregationPerformanceInternals

Read more →

How DataFusion Approximates Quantiles with a Mergeable t-Digest (and Distinct Counts with HyperLogLog)

Oct 21, 2026 9 min read Jay Hubbert

DataFusion’s approx_percentile_cont compresses values into weighted centroids whose state can be merged across partitions — approximately, not exactly.

DatafusionFunctionsPerformanceInternals

Read more →

← Newer Page 41 of 83 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·