Dictionary-shaped takes decode every row of FoR, ALP and ZigZag values

未关闭
#12,071 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust

调研方向

Start by reading #12048 and #11890, then locate the TakeExecuteAdaptor and the take kernels for FoR, ZigZag, and ALP. Add benchmarks comparing pushdown with decoding values before gathering across several codes-to-values ratios, recording time and allocations. Use the results to recommend where the rule belongs and whether a length threshold or ratio is appropriate; preserve pushdown for Sparse, RunEnd, Sequence, and Chunked.

由索引模型根据 Issue 内容生成。

描述

This concerns take on encodings that wrap a child and decode it one element at a time: FoR, ZigZag, ALP, ALPRD, Delta and Widen. In Vortex, ArrayRef::take builds a lazy DictArray(indices, values). Each of these encodings registers a TakeExecuteAdaptor kernel for a Dict parent. So a real dictionary column, such as Dict(codes, FoR), takes the same path as a plain take.

When the codes outnumber the values, the kernel still pushes the codes into the encoded child and returns a full-length array, such as FoR(take(encoded, codes)). So one execution step turns a dictionary-encoded column into a full-length encoded array. The decode then runs once per row instead of once per distinct value. Nobody has measured what this costs in time or memory.

#12048 adds a guard to ZigZag only. Its take kernel declines when indices.len() > array.len(), so Dict decodes its values first and stays a Dict. No benchmark measures that guard, and FoR and ALP keep the old path. The length test is also only a stand-in for "this take is dictionary-shaped".

Questions to answer with benchmarks:

  1. For Dict over FoR, ZigZag and ALP values, which is faster: pushing the take into the encoded child, or decoding the values and then gathering? Measure several ratios of codes to values, and what each path allocates.
  2. Does the answer differ by encoding? ZigZag decodes with a shift and an XOR, while ALP multiplies and applies patches.
  3. If decoding first wins, should the rule live once in TakeExecuteAdaptor as an opt-in, or in each encoding's kernel? Sparse, RunEnd, Sequence and Chunked rely on the pushdown and must keep it.
  4. Is indices.len() > array.len() the right test, or should the rule use a ratio of codes to values?

Related to #11890.

🤖 Generated with Claude Code

主要语言
Rust
星标
3.2k
派生
239
平均合并
1 天 4 小时
30 天内合并 PR
684

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vortex-data/vortex 的其他 Issue

查看 vortex-data/vortex 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。