omnigraph/crates
Ragnor Comerford f0641210a3
fix(engine): coerce pushdown filter literals to the column type
Filter literals were pushed to Lance in their natural Arrow type (every integer
Int64, every float Float64). Against a narrower indexed column DataFusion widens
to the literal's type and casts the COLUMN (`CAST(n32 AS Int64)`), which defeats
the scalar BTREE and degrades to a full filtered read. A physical-plan probe
confirms it: an Int32 column filtered by an i32 literal uses `ScalarIndexQuery`;
by an i64 literal it does not.

Thread the scan's `arrow_schema` through `build_lance_filter_expr` ->
`ir_filter_to_expr` and coerce each literal operand to the opposite column's
exact Arrow type, reusing `projection::literal_to_array` + `arrow_cast` (the same
path the in-memory arm uses, so the two arms agree). Coercion never demotes a
filter to None: on failure it falls back to the natural literal, because a node
scan has no in-memory fallback for inline filters.

Supersedes the date-specific change in e4ef67b (PR1): the probe shows dates were
never index-defeated — temporal coercion casts the LITERAL, not the column — so
PR1's index-use rationale was wrong though harmless. The generic coercion
subsumes it; `literal_to_expr`'s date arms revert to the natural Utf8 fallback,
and its unit tests now assert the live coerced path.

Tests: surface guard `scalar_index_use_requires_matched_literal_type` pins the
substrate behavior (matched -> index, widened -> column-cast full scan); unit
tests cover Int32/UInt32/Float32 coercion, range op, reversed operand order, and
the natural fallback; `literal_filters` adds an I32 column with equality + range
and an F32 pushdown case.
2026-06-13 19:48:03 +02:00
..
omnigraph fix(engine): coerce pushdown filter literals to the column type 2026-06-13 19:48:03 +02:00
omnigraph-api-types refactor(api): extract omnigraph-api-types crate (RFC-009 Phase 2) 2026-06-13 17:03:20 +03:00
omnigraph-cli refactor(cli): collapse write/query forks onto GraphClient (RFC-009 Phase 3b) (#211) 2026-06-13 19:25:57 +03:00
omnigraph-cluster Recovery liveness, storage fault-injection matrix, and one storage implementation over object_store (#203) 2026-06-13 11:20:08 +02:00
omnigraph-compiler release: bump workspace to 0.7.0 2026-06-12 14:12:33 +03:00
omnigraph-policy release: bump workspace to 0.7.0 2026-06-12 14:12:33 +03:00
omnigraph-server refactor(api): extract omnigraph-api-types crate (RFC-009 Phase 2) 2026-06-13 17:03:20 +03:00