-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow setting default value for RecordField #24
Comments
Hello! I understand the use-case and I think it makes sense to have it. |
Thanks for the response. The generic option you suggested seems reasonable to me. |
The downside of that though is that if we then add a field to the structured list it won't show in |
Another issue is that currently I do not leak the |
Hey, Trying to think through some of the issues you've raised. I am not quite clear - can you please explain why adding a field to the structured list won't show in extra_attributes? |
If I have a struct RecordField {
...
extra_attributes: Vec<(String, serde_json::Value)>, but then I decide that a particular attribute needs to live in I would need to turn it into: struct RecordField {
...
doc: String,
extra_attributes: Vec<(String, serde_json::Value)>, which would probably imply removing it from Alternatively I could have Either way I also need to add "stuff every parsed but unused property in there" which also complexifies the parsing code especially if I want to add this All in all I think I'm leaning towards just adding it as Main thing to work out in this case is how to make the difference between absent field and |
Hello,
I am wondering if it would be possible to allow the user to set or change a
default
field on the RecordField struct. This is possible in apache_avro: https://docs.rs/apache-avro/latest/apache_avro/schema/struct.RecordField.html.The reason I am asking for this is that is required if you want to properly handle schema evolution while using trino to read avro data: https://trino.io/docs/current/connector/hive.html#avro-schema-evolution. In particular, we are writing structs to tables that are read by trino. If we want to add a field to that struct, the schema must have a default value in order for trino to be able to read older data that was written before the field was added.
Please let me know if what I am asking for is unclear.
Thank you,
Alex
The text was updated successfully, but these errors were encountered: