Push fallible scalar functions through sparse Dict arrays
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 52/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- rust
- Domínio
- data-engineering, performance
Direção de pesquisa
Start by reading vortex-array/src/arrays/dict/compute/rules.rs, especially DictionaryScalarFnValuesPushDownRule and the handling of has_all_values_referenced(). Benchmark the existing row-wise and dictionary push-down paths for sparse dictionaries, including fallible functions such as utf8_to_json and checked integer division. Done means sparse dictionary values are evaluated through the new path when the heuristic permits, while edge cases and regressions are covered by benchmarks and tests.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem or motivation
DictionaryScalarFnValuesPushDownRule (vortex-array/src/arrays/dict/compute/rules.rs) skips fallible scalar functions when has_all_values_referenced() is false, because a reduce rule cannot inspect codes to avoid evaluating unreferenced entries. On sliced or filtered dictionaries (where all_values_referenced is reset), fallible scalar functions like utf8_to_json, json_to_utf8, parse_uuid, or checked integer division fall back to row-wise execution, re-evaluating duplicate values and losing dictionary encoding downstream.
Proposed solution
Add an execution-time ExecuteParentKernel<Dict> for AnyScalarFn that handles sparse dictionaries (!has_all_values_referenced() and !signature.is_infallible()), gated by a benchmarked heuristic so it only runs when it beats row-wise execution.
Two approaches to evaluate and benchmark:
- Masking unreferenced values (strict functions only): use
DictArrayExt::compute_referenced_values_maskto mask out unreferenced entries invalues, then evaluate the scalar function on the masked values without allocating a rank table, remappingcodes, or copyingvalues. - Compacting referenced values (works for non-strict functions too): scan
codesto buildreferenced_indicesand remapcodes, gather referenced values, evaluate the scalar function once per distinct referenced value, and return aDictwithall_values_referenced = true.
Open questions:
- What cardinality ratio (
values.len() / codes.len()) or function-cost signal prevents regressions on cheap fallible functions (such as integer division) over near-dense dictionaries? - Should this decline on non-host (CUDA) codes, empty inputs, and strict functions with null constant siblings (to preserve short-circuiting and execution-time checks)?
Additional context
Prototype and review discussion in #12537 (closed pending benchmarks and a clear cost heuristic). Related to #12535 and #11693.
- Linguagem predominante
- Rust
- Estrelas
- 3.2k
- Forks
- 239
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 684
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de vortex-data/vortex
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
vortex-data/vortex#12633 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
vortex-data/vortex#12628 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
vortex-data/vortex#12491 ·
Mantenedores costumam responder em até 1 dia
-
Fallible constructor for nested_case_whenTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
vortex-data/vortex#11425 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 67/100
vortex-data/vortex#12635 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de vortex-data/vortex
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
valkey-io/valkey-glide#7975 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
marklauter/tsong#110 ·
-
docs enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia