cdc-apache-cassandra
cdc-apache-cassandra copied to clipboard
[Source][NativeJsonConveter] Use logical types instead of names to select the proper type converter
For logical types, the AVRO schema.getLogicalType()
always returns null although the name of the logical type is populated. The NativeJsonConverter for now relies on the schema.getName()
instead to select the right converter. Some debugging is required to decide why the logical type is not populated. Here is an example:
{
"name": "xdecimal",
"type": [
"null",
{
"type": "record",
"name": "cql_decimal",
"namespace": "",
"fields": [
{
"name": "bigint",
"type": "bytes"
},
{
"name": "scale",
"type": "int"
}
],
"logicalType": "cql_decimal"
}
]
}
schema.getLogicalType()
is expected to return cql_decimal
but it returns null instead.