flavray / avro-rs

Avro client library implementation in Rust
MIT License
169 stars 95 forks source link

Logical types cannot be backed by a [null, T] union #122

Closed cpcloud closed 4 years ago

cpcloud commented 4 years ago

cc @AustinHunt

This prevents nullable logical type values from being written.

cpcloud commented 4 years ago

@AustinHunt according to https://github.com/apache/avro/pull/329/files#diff-fd4b8a3427b9b38bda3e310e0871378c, the correct way to specify nullable logical types is not with

{"type": ["null", "long"], "logicalType": "timestamp-micros"}

but with

{"type": ["null", {"type": "long", "logicalType": "timestamp-micros"}]}

This can currently be parsed successfully by avro-rs. I'm investigating read/write paths for this now.