-
Notifications
You must be signed in to change notification settings - Fork 662
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
Null fields are omitted by infer_json_schema_from_seekable
#4814
Comments
What type would you expect to be inferred for null fields? |
I think const DATA: &str = r#"{"a": 1, "b": "str", "c": null, "d": []}"#; will create a schema with Creating data frames with such schema is a bit different topic, I guess not all output formats support null columns, however there is https://docs.rs/arrow/latest/arrow/array/struct.NullArray.html so:
|
Does the JSON reader support DataType::Null? |
Yes, in fact it does and it generates
|
In which case I see no issue with the proposed change |
|
Describe the bug
Fields with only null values are skipped when inferring
Schema
, which makes reader in strict mode fail as it stumbles upon field which is not included in the schema. In any case, silently removing the fields that are in the input seems wrong - maybe this should be controlled by an option to inference function or it should be left up to the user to filter out null fields.To Reproduce
produces
Expected behavior
test passes
Additional context
tested with arrow 46
The text was updated successfully, but these errors were encountered: