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

Problem decoding union of map: Failed to convert JSON to Avro #59

Open
nicodv opened this issue Sep 8, 2021 · 2 comments
Open

Problem decoding union of map: Failed to convert JSON to Avro #59

nicodv opened this issue Sep 8, 2021 · 2 comments
Assignees

Comments

@nicodv
Copy link

nicodv commented Sep 8, 2021

Example schema:

protocol ScoreData {
  record ScoreData {
    string id;
    union {null, map<double>} multiScore = null;
  }
}

Example payload:

"{\"id\":\"myKey\",\"multiScore\":{\"map\":{\"a\":10.0}}}"

Exception:

tech.allegro.schema.json2avro.converter.AvroConversionException: Failed to convert JSON to Avro: Could not evaluate union, field multiScore is expected to be one of these: NULL, MAP. If this is a complex type, check if offending field: multiScore adheres to schema.

AFAICT, this is syntactically valid JSON for a union{null, map}. I've tried with avro4s too and it decodes things without issues.

Version: 0.2.10

@andzelika-domanska
Copy link

Hi @nicodv :)
I'll take a closer look at this issue.

@etsybaev
Copy link

Hi there.

Are there any updates? It seems like we have a branch of onCall issues caused by this one. For example https://github.com/airbytehq/oncall/issues/1047, https://github.com/airbytehq/oncall/issues/1089, and so on.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants