Closed kellen closed 4 years ago
Idrees looked into this a little and found that this was an implicit resolution issue where the Option converter was being bypassed entirely due to the location of the validation type definition.
There is a workaround, I confirmed that defining the implicit manually like this worked for Kellen:
implicit val simpleConverter = new AvroSimpleTypeConverter[Country, String]
(this is private scoped to com.spotify.elitzur, so you'll have to use that package; once you define this you also have to exclude the default implicit simpleConverter for BaseValidationTypes from the avro._ import)
I am going to continue to leave this open for now to try and figure out (1) a way of changing packages/imports/etc so the implicits resolve in the correct order in this case or at least (2) a way of simplifying the workaround
I looked into this more with Kellen. In that pipeline, the error was conflated with an issue where a companion object needed to be defined for the BaseValidationType
with SimpleCompanionImplicit
in order for avro conversions to be correctly generated. Closing this issue as it's now been resolved in Kellen's pipeline. Feel free to open a new issue if you see something that confuses you!
Upgrading to scio 0.95 and running into a previously-worked-around AvroConverter issue.
I have a validation type:
And a case class that uses it:
And an attempt to convert:
To this schema:
And deep in the internals of
DerivedConverter
I’m seeingCountry
being evaluated against a schema of"string"
, which should work but which instead is passed toGenericRecordBuilder
and results in:I had previously worked around this by round-tripping to bytes which no longer works:
My suspicion is that the
Option
wrapper is breaking an otherwise working path