changefeedccl: provide string fallback for values that can't be represented in Avro
CockroachDB's native types usually map to Avro values with decent fidelity, but there are some cases where the Avro types can't represent everything that CockroachDB can. Specifically, this can happen with variable-precision decimals (see this TODO) and with dates that are out of the range supported by Avro (see #37508).
All fields in our Avro schemas are already treated as unions with null, for compatibility reasons. For types where there is not a full-fidelity Avro representation of every value, we should extend this union to contain a string representation, which will be used in cases where the CockroachDB value isn't representable in Avro.
Zendesk ticket #3388 has been linked to this issue.
@rolandcrosby or @awoods187 Any idea when this will get addressed?
@rolandcrosby and/or @awoods187 ping?
Hi @BramGruneir, I don't think anyone committed to working on this in 19.2. Is there a specific type that is needed that can't be worked around? The linked ticket says the customer is having issues with DECIMAL. CockroachDB 19.1 does support decimals when producing Avro output, but providing arguments (precision and scale) in the column definition is required. If that's not suitable, we can look at picking this up as a bulk I/O project.
Closing: We are adding support for additional CR types for avro encoding in 21.2. As more types are created, we want to consider each individually instead of encoding them all as strings.
https://github.com/cockroachdb/cockroach/pull/67433