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

bug: round trip FixedSizeList lance <-> arrow. nullability is not preserved #2304

Open
universalmind303 opened this issue May 6, 2024 · 2 comments

Comments

@universalmind303
Copy link
Contributor

round tripping native lance Field from ArrowField and back drops the nullable field.

let arrow_field = ArrowField::new_fixed_size_list(
    "list",
    ArrowField::new("item", DataType::Int32, false),
    1,
    false,
);
let field = Field::try_from(&arrow_field).unwrap();

assert_eq!(field.name, "list");
assert_eq!(field.nullable, arrow_field.is_nullable());
assert_eq!(&field.data_type(), arrow_field.data_type());
assert_eq!(ArrowField::from(&field), arrow_field);

it seems that we drop it because Field::data_type calls impl TryFrom<&LogicalType> for DataType, which hard codes the nullable field.

@universalmind303 universalmind303 changed the title bug: round trip FixedSizeList lance <-> arrow. nullable is not preserved bug: round trip FixedSizeList lance <-> arrow. nullability is not preserved May 6, 2024
@wjones127
Copy link
Contributor

Yeah the underlying problem is that when we implemented FixedSizeList data type, we decided not to make the inner field an actual field. It just serialized the data type, and doesn't handle any metadata, nullability, or child fields. This also blocks #1293

I started to fix this in #1693, but it causes drastic breaking changes in how schemas and page tables are handled.

@universalmind303
Copy link
Contributor Author

universalmind303 commented May 8, 2024

I started to fix this in #1693, but it causes drastic breaking changes in how schemas and page tables are handled.

is it possible to do this in a backwards compatible way?

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

2 participants