Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Extend mapping DSL to support Avro enum fields #208

Open
asnare opened this issue Apr 13, 2018 · 1 comment
Open

Extend mapping DSL to support Avro enum fields #208

asnare opened this issue Apr 13, 2018 · 1 comment

Comments

@asnare
Copy link
Member

asnare commented Apr 13, 2018

At present our mapping DSL cannot map to values onto enum Avro fields. Mapping verification during startup detects a mismatch between the mapping and the Avro type.

This issue covers extending the DSL to allow string-based values to be mapped to Avro enumerations, so long as the string value corresponds to one of the values for the enumeration. (If it doesn't then the mapping would be absent.)

Tests will need to check:

  • This works for a literal.
  • This works for a string-based value provider.
  • Unknown values are treated as absent.
@asnare
Copy link
Member Author

asnare commented Apr 18, 2018

Currently in most places within the mapping DSL any type conversions are explicit and of the form:

parse aField() as int

Given that this is a form of type conversion we should use the same sort of syntax. Something like:

parse theField() as enum

This makes it clear that the type conversion is expected is consistent with other type conversions that we support.

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

No branches or pull requests

1 participant