Ray's Knowledge Base
Unlock

duql wildcard path segments expand from the index catalog before lowering

DecisionVerified 4 Oct 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.

Context#

Queries over traces with hundreds of similar nested paths needed one term per path.

Decision#

  • * replaces one path segment after the first. It is allowed only as a select item (no alias), in drop/unpivot lists, and as the argument of any()/all() in a comparison. A wildcard is a PathStep with unquoted key "*".
  • Expansion (duql/wildcard.cpp) rewrites the syntax tree in compile_program from a lazy LeafPaths callback (the View passes its merged catalog via schema_tree) before lowering. any/all over a pattern become a three-valued OR/AND of plain comparisons, so pruning applies.
  • Order: segment by segment, numeric segments by value and before others.
  • A query's automatic index build writes only checkpoints, so the path catalog (statistics tier, require_bloom) is missing and View.columns shows only declared fields. Wildcards on such a trace fail naming the file and dftracer_index.

Why#

Measured: wildcard filter 377 ms against a 200-term OR at 379 ms.

Rejected options#

  • Expansion against derive/group columns: needs per-stage expansion.
  • Implicit any for a bare pattern.

Also found by searching

  • duql wildcard path star segment
  • wildcards on a trace fail naming the file and dftracer_index
  • View.columns shows only declared fields after automatic index build
  • where is wildcard expanded in duql compile_program