Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic in push_down_filter #2602

Open
ryzhyk opened this issue Jun 15, 2024 · 2 comments
Open

panic in push_down_filter #2602

ryzhyk opened this issue Jun 15, 2024 · 2 comments
Labels
binding/rust Issues for the Rust crate bug Something isn't working

Comments

@ryzhyk
Copy link

ryzhyk commented Jun 15, 2024

Environment

Delta-rs version: v0.18.0

Binding: Rust

Environment:

  • Cloud provider: na
  • OS: Linux
  • Other:

Bug

What happened:

Running the following query: select * from snapshot where id > 10000 and id < 20000 against a Delta table panics with:

called `Result::unwrap()` on an `Err` value: Context("Optimizer rule 'push_down_filter' failed", Internal("Vec returned length: 1 from supports_filters_pushdown is not the same size as the filters passed, which length is: 2"))

If I remove the second condition and just leave select * from snapshot where id > 10000, it works. I believe this is a regression in v0.18.0, since this worked before.

What you expected to happen:

How to reproduce it:

Here is a complete repro:

use std::sync::Arc;
use deltalake::{datafusion::prelude::SessionContext, DeltaTableBuilder};

#[tokio::main(flavor = "multi_thread", worker_threads = 10)]
async fn main() {

    let datafusion = SessionContext::new();

    let table_builder = DeltaTableBuilder::from_uri("data");
    let delta_table = Arc::new(table_builder.load().await.unwrap());
    datafusion.register_table("snapshot", delta_table).unwrap();

    let df = datafusion
        .sql("select * from snapshot where id > 10000 and id < 20000")
        .await
        .unwrap();

    df.collect().await.unwrap();

}

where data contains an empty delta table.

Here is a complete repro, including Rust code and the empty table: conjunctive_join.zip. Just run cargo run to reproduce.

More details:

@ryzhyk ryzhyk added the bug Something isn't working label Jun 15, 2024
@rtyler rtyler added the binding/rust Issues for the Rust crate label Jun 15, 2024
@rtyler
Copy link
Member

rtyler commented Jun 15, 2024

thanks for the repro code, we'll take a looksee

ryzhyk pushed a commit to feldera/feldera that referenced this issue Jun 15, 2024
There is a regression in delta-rs 0.18, which I reported here:
delta-io/delta-rs#2602

I had to simplify the tests to avoid the panic for now.  It should be
possible to just revert this commit when the bug has been fixed.

Signed-off-by: Leonid Ryzhyk <[email protected]>
ryzhyk pushed a commit to feldera/feldera that referenced this issue Jun 15, 2024
There is a regression in delta-rs 0.18, which I reported here:
delta-io/delta-rs#2602

I had to simplify the tests to avoid the panic for now.  It should be
possible to just revert this commit when the bug has been fixed.

Signed-off-by: Leonid Ryzhyk <[email protected]>
@rtyler
Copy link
Member

rtyler commented Jun 15, 2024

I have taken your test code and created a failing test in this pull request which we can start to fix #2604

vigimite added a commit to vigimite/aqueducts that referenced this issue Jun 22, 2024
aolwas added a commit to aolwas/adt that referenced this issue Jul 5, 2024
looks like issue delta-io/delta-rs#2602.
still opened but upgrading dependencies seems to have fix the
probleme here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants