Hi Chris, Folks...
Am Freitag, dem 13.08.2021 um 13:00 -0400 schrieb Chris Cranford:
> Hi Bernd -
>
> Interesting, so that definitely sounds like a bug then if you're on
> 1.6. Could you open a Jira if you haven't already with the details
> and
> we'll take a look to see if its something with the SMT?
>
Sorry for the delay, got other issues to solve before...
I've investigated this a little more this morning and finally
recognized what's going on here: I'm using the default
SimpleHeaderConverter in my configuration, which is called on the sink
side when reading in the SinkRecord. This uses its toConnectHeader()
method which doesn't recognize the schema attached to the header values
but reparses the content of the header.
toConnectHeader() then returns a SchemaAndValue object which
dynamically attaches a value schema based on the result of
Values.parseString(), which converts the header value into an
appropiate type it thinks is the closest one (also stated in its
documentation). So, if the number is high enough, it gets its correct
final type, depending on its precision. I've tested this with a custom
field injected into the header via ExtractNewRecordState.
Depending on the size of the number you either get an INT32 (for e.g
2^16) or INT64 (for e.g. 2^63).
So everything looks right, no bug involved here. A correct solution
looks like i just need to watch out for the correct type(s) and convert
them into a BigDecimal...
Thanks,
Bernd