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

Index out of bounds error when selecting qualified projections from postgres #157

Open
mjberends-yurts opened this issue Oct 29, 2024 · 4 comments

Comments

@mjberends-yurts
Copy link

mjberends-yurts commented Oct 29, 2024

Issue

Running the postgres example with query SELECT name FROM companies seems to trigger a panic.

   Compiling datafusion-table-providers v0.2.3 (...)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 14.49s
     Running `target/debug/examples/postgres`
thread 'main' panicked at .../datafusion-common-42.1.0/src/dfschema.rs:341:31:
index out of bounds: the len is 1 but the index is 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

These queries work fine:

  • SELECT id FROM companies
  • SELECT id, name FROM companies

It looks like when specifying column N, columns 0...N must also be specified. (The order doesn't matter.) This looks to be a recent issue introduced by datafusion 42.0.

I would love any help tracking down what might be happening.

@derekleverenz
Copy link

This seems like its being caused by using plan_to_sql if its the same issue as being seen here apache/datafusion#12773

@derekleverenz
Copy link

derekleverenz commented Nov 14, 2024

I tested locally by reverting #106 and this example worked just fine, which seems to indicate that it is an issue with plan_to_sql

@phillipleblanc
Copy link
Collaborator

It looks like it was recently fixed in apache/datafusion#13326 - which means DataFusion v44 will have the fix.

@derekleverenz
Copy link

Oh excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants