a predicate comparing two columns should select through the vectors' own comparison, not generated code
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read src/test/clojure/xtdb/scalar_predicate_test.clj and the existing scalar predicate kernels from #4969 to see how their selection is checked against the generated selection spec. Then inspect expression.clj's ->scalar-predicate, ScalarCompare.kt, and evalWords; the issue calls for same-type column comparisons under and/or/not, with NULL, NaN, and signed zero behavior covered. Done means the oracle test confirms matching selections for covered types and unsupported pairs fall back per batch.
由索引模型根据 Issue 内容生成。
描述
A predicate comparing two columns of a batch, l_commitdate < l_receiptdate, should select through the vectors' own comparison, as a column against a literal or param already does.
-
#4969's kernels cover a column against a literal or param only
A leaf with a column on both sides makes the recogniser decline, so the whole predicate — itsand/or/notsiblings included — runs as generated per-row code. -
TPC-H's Q4, Q12 and Q21 filter on two
lineitemdate columns- check: their share of query time spent in the generated predicate is unmeasured.
Problem
-
->scalar-predicate(expression.clj) returns nil for a leaf without a literal or param operand
So one such leaf takes the whole predicate off the kernel. -
The vectors' compare loops take a scalar right-hand side
Vector.compare(op, rhs, sel, mask)reads one value per batch; a column right-hand side needs a second vector read in the same branch-free word loop (evalWords,ScalarCompare.kt), its validity ANDed in.
Potential approach
-
goal: a leaf comparing two columns of one covered type is a kernel leaf
These four are jointly sufficient.-
Covered means the types #4969 covers against a literal
i8–i64,f32,f64anddatewith all sixCmpOps;utf8andvarbinarywithEQ/NEQonly. -
Each covered vector compares itself against another vector of its own type
AVector.compareoverload taking a vector right-hand side. NULL on either side is not selected; NaN and ±0.0 as the generated code has them. -
Both sides read through one
seland mask
A predicate's columns are all columns of its input relation, which views them through one indirection.x < xneeds nothing special. -
The recogniser builds the leaf under the existing
and/or/not, falling back per batch where either vector isn't covered, and pinned by an oracle test against the generated selection spec, assrc/test/clojure/xtdb/scalar_predicate_test.cljdoes.
-
Out of scope
- Mixed-type pairs (
i64againstf64,dateagainsttimestamp), which the generated code promotes; they decline. - A column against an expression (
l_a + 1 < l_b). - Join conditions comparing columns of two relations.
- 主要语言
- Clojure
- 星标
- 3.1k
- 派生
- 193
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 73
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
xtdb/xtdb 的其他 Issue
-
unshaved-yak
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
sql unshaved-yak
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
flaky
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
metrics
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
相似的 Issue
-
.Needs Triage .Team/UXWest Misc/Accessibility Priority:P3 Type:New Feature
难度 2/5 1-3 小时 新手友好度 78/100
metabase/metabase#88153 · 1 条评论 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
editor-code-assistant/eca#717 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
nasa/Common-Metadata-Repository#2544 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100