Simplified filter expression has a Null type instead of Int64 type across the FFI layer
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Domínio
- backend, data-engineering
Direção de pesquisa
Comece pelo MRE vinculado, especialmente por repro.py e pelo diretório repro_provider, e depois compare as branches main e datafusion52. Execute as etapas maturin develop e python repro.py para reproduzir o panic de LIMIT 5 e execute o cargo test correspondente para SELECT * FROM dummy_table WHERE a < 5 para comparar o comportamento com e sem a camada FFI. Considera-se concluído quando a consulta FFI for bem-sucedida sem a assertion Null-versus-Int64.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
A custom table provider for a ParquetSource with a trivial catalog and an Int64 column yields some errors when a SQL query has a filter with a literal limit on that column of the form
assertion `left == right` failed: Simplified expression should have the same data type as the original
left: Null
right: Int64
The error does not occur when using datafusion-python 52; it also does not occur when running the query purely in a Rust SessionContext; the backtrace for the above error shows it coming from datafusion-ffi code as well.
This may of course not be a bug, but instead some bad practice that the version 52 set of crates tolerates but which is now invalid. A MRE of this custom table provider can be found in the public repo https://github.com/jwimberl/datafusion_python_53_int64filter_repro, which contains
- a non-working datafusion53 version (in branch main)
- a baseline working version (in branch datafusion52)
and a canned dummy dataset. The README.md of this repo has more details.
To Reproduce
In the main branch, build the py_repro_provider crate with maturin develop and run python repro.py. This loads the dummy dataset as a table dummy_table and runs two queries
SELECT * FROM dummy_table LIMIT 1, which is successfulSELECT * FROM dummy_table LIMIT 5, which panics
Itss output should be something like
Successful query:
a b
0 0 42
Unsuccesful query:
thread '<unnamed>' panicked at /home/jwimberley/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/datafusion-physical-expr-53.1.0/src/simplifier/mod.rs:76:17:
assertion `left == right` failed: Simplified expression should have the same data type as the original
left: Null
right: Int64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
followed by backtrace information.
Expected behavior
In the datafusion52 branch, build thepy_repro_provider with maturin develop and run python repro.py. It runs the same two queries, and its output should be
Successful query:
a b
0 0 42
Also successful query:
a b
0 0 42
1 1 42
2 2 42
3 3 42
4 4 42
Additional context
In either the main branch or datafusion52 branch, the Rust code for the table provider is in the directory repro_provider, and there is a corresponding cargo test that runs SELECT * FROM dummy_table WHERE a < 5. Without the FFI layer, this is successful with both datafusion 52 and 53.
- Linguagem predominante
- Python
- Estrelas
- 605
- Forks
- 176
- Merge médio
- 1d 23h
- PRs com merge (30d)
- 8
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
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 apache/datafusion-python
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/datafusion-python#1726 ·
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 88/100
apache/datafusion-python#1691 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/datafusion-python#1644 ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
apache/datafusion-python#1737 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
apache/datafusion-python#1735 · 1 comentário ·
Todas as issues de apache/datafusion-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
ClickHouse/clickhouse-connect#1057 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
open-telemetry/sig-end-user#406 ·
-
bug ci good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100