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

native table issues with FixedSizeList + case sensitive column names. #2777

Closed
universalmind303 opened this issue Mar 13, 2024 · 2 comments · Fixed by #2876
Closed

native table issues with FixedSizeList + case sensitive column names. #2777

universalmind303 opened this issue Mar 13, 2024 · 2 comments · Fixed by #2876
Labels
bug Something isn't working

Comments

@universalmind303
Copy link
Contributor

Description

a simple table with two fields "Text", and embeddings

> select * from lance_scan('./embeddings');
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────┐
│ embeddings                                                                                              │ Text │
│ ──                                                                                                      │ ──   │
│ FixedSizeList<Float32; 1536>                                                                            │ Utf8 │
╞═════════════════════════════════════════════════════════════════════════════════════════════════════════╪══════╡
│ [0.019264393, -0.06450473, -0.0016729431, 0.07811243, 0.021637829, -0.015546009, -0.015044951, 0.04578… │ Hel… │
│ [-0.008556553, -0.028633503, 0.008491013, 0.11569916, -0.036906052, -0.027395533, 0.010631972, 0.03783… │ Wor… │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┘

I can query the table fine, and even save it as a "native" table

create table delta as select * from lance_scan('./embeddings');
Table created

but if i try to select from it, i get a panic

> select * from delta;
thread 'main' panicked at crates/datasources/src/native/access.rs:458:87:
called `Result::unwrap()` on an `Err` value: SchemaError(FieldNotFound { field: Column { relation: None, name: "text" }, valid_fields: [Column { relation: None, name: "embeddings" }, Column { relation: None, name: "Text" }] }, Some(""))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It looks like the 'embeddings' field is dropped somewhere?

> select * from list_columns(default, public, delta);
┌─────────────┬───────────┬──────────┐
│ column_name │ data_type │ nullable │
│ ──          │ ──        │ ──       │
│ Utf8        │ Utf8      │ Boolean  │
╞═════════════╪═══════════╪══════════╡
│ Text        │ Utf8      │ true     │
└─────────────┴───────────┴──────────┘
> select embeddings from delta;
Error: Schema error: No field named embeddings. Valid fields are delta."Text".
@tychoish
Copy link
Contributor

How does this relate to your previous changes to the metadata on the tables to address the handling of types like these? Is this a regression or was that fix incomplete?

@universalmind303
Copy link
Contributor Author

This is an edge case when one of the fields is case sensitive.

the old one #2547 was closed via #2607, but case sensitive fields were not tested. if we go through that flow again, but make a field case sensitive, it results in an error.

> create table test as select vector, point as "Point" from lance_scan('./testdata/lance/table1');
> select * from test;
thread 'main' panicked at crates/datasources/src/native/access.rs:458:87:
called `Result::unwrap()` on an `Err` value: SchemaError(FieldNotFound { field: Column { relation: None, name: "point" }, valid_fields: [Column { relation: None, name: "vector" }, Column { relation: None, name: "Point" }] }, Some(""))

@universalmind303 universalmind303 changed the title native table issues with FixedSizeList native table issues with FixedSizeList + case sensitive column names. Mar 18, 2024
universalmind303 added a commit that referenced this issue Apr 10, 2024
closes #2777

Note: 
`ident` preserves case sensitivity while `col` does not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants