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

Support ISO 8601 parsing to TimestampMicros #165

Open
KannarFr opened this issue Dec 1, 2020 · 1 comment
Open

Support ISO 8601 parsing to TimestampMicros #165

KannarFr opened this issue Dec 1, 2020 · 1 comment

Comments

@KannarFr
Copy link

KannarFr commented Dec 1, 2020

Why?

TimestampMicros expected, got String

Reason

fn resolve_timestamp_micros(self) -> Result<Self, Error> {
  match self {
      Value::TimestampMicros(ts) | Value::Long(ts) => Ok(Value::TimestampMicros(ts)),
      Value::Int(ts) => Ok(Value::TimestampMicros(i64::from(ts))),
      other => Err(Error::GetTimestampMicros(other.into())),
  }
}

Suggestion

Try convert String to ISO 8601 and then to long for TimestampMicros and TimestampMillis avro impl.

@flavray WDYT?

@flavray
Copy link
Owner

flavray commented Dec 3, 2020

It looks like this would go against the Avro specification (if I understand your request correctly, feel free to correct me if I'm wrong!). I would be inclined to try to keep the implementation as close to the specification as possible, in order to make operability with other implementations of Avro (be it in rust or other languages) less tricky.
@poros do you have any opinion?

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