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

Layout readers do not handle projections with repeated columns #712

Open
danking opened this issue Sep 3, 2024 · 3 comments
Open

Layout readers do not handle projections with repeated columns #712

danking opened this issue Sep 3, 2024 · 3 comments
Assignees

Comments

@danking
Copy link
Member

danking commented Sep 3, 2024

I expected this test to pass

#[tokio::test]
async fn test_repeated_projection() {
    let strings = ChunkedArray::from_iter([
        VarBinArray::from(vec!["ab", "foo", "bar", "baz"]).into_array(),
        VarBinArray::from(vec!["ab", "foo", "bar", "baz"]).into_array(),
    ])
    .into_array();

    let st = StructArray::from_fields(&[("strings", strings)]);
    let buf = Vec::new();
    let mut writer = LayoutWriter::new(buf);
    writer = writer.write_array_columns(st.into_array()).await.unwrap();
    let written = writer.finalize().await.unwrap();

    let mut stream = LayoutReaderBuilder::new(written, LayoutDeserializer::default())
        .with_projection(Projection::new([0, 0]))
        .with_batch_size(5)
        .build()
        .await
        .unwrap();

    stream.next().await.unwrap().unwrap();
}

but instead I get this error. Line 69 is the last line of the test.

---- layouts::tests::test_repeated_projection stdout ----
thread 'layouts::tests::test_repeated_projection' panicked at vortex-serde/src/layouts/tests.rs:69:34:
called `Result::unwrap()` on an `Err` value: Wrong state transition, message [0, 1] (with range [0, 576)) should have been fetched
Backtrace:
disabled backtrace
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@AdamGS
Copy link
Contributor

AdamGS commented Sep 3, 2024

I think we should just dedup/fail gracefully right?

@robert3005
Copy link
Member

This should work imho. Right now the reader is dumb and just assumes unique set of columns is being read

@robert3005
Copy link
Member

I think this is the wrong level to make it work at. This should be unique set of columns to read. You can duplicate column at higher level

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