Hei Guys,

-- off topic
I hope this is the correct mailing list. I tried to send on user list first but
the mail bounced because I haven't subscribed the mailing list. However, I
didn't figure out where I can subscribe =/
--

This concerns the rust crate apache-avro.


Does anyone know if it's possible, to use type aliases with serde serialization?

When trying to serialize an object using `writer.append_ser` I get the following
error:

  called `Result::unwrap()` on an `Err` value: There is no entry for date in 
the lookup table: {"name": String("Great Meeting"), "time": Union(0, Null)}.

Renaming `time` to `date` would fix the issue, but the goal is to simulate
renaming a propetry as part of a schema evolution.


With the following schema:

  const RAW_SCHEMA_V2 : &str = r#"
  {
      "type": "record",
      "name": "Conference",
      "namespace": "sth",
      "fields": [
          {"type": "string", "name": "name"},
          {"type": ["null", "long"], "name": "date", "aliases" : [ "time" ]},
      ]
  }"#;


And the struct:

  #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
  pub struct Conference {
      pub name: String,
      pub time: Option<i64>,
  }


Thank you for any hint on what I'm doing wrong =)
Josua

Reply via email to