简体   繁体   中英

kafka-connect org.apache.avro.SchemaParseException: Illegal character $

I'm using jdbc source connector and getting below error when I want to connect with a table that has "$" in the name.

org.apache.avro.SchemaParseException: Illegal character <<tablename>>$

I tried escaping this with utf-8 like tablename\$, still the same error.

How to deal with these special chars?

It looks like the schema validation isn't happy with the schema name that has been created from your table name. You can override this with SetSchemaMetadata , there is an example in the docs like this:

"transforms": "SetSchemaMetadata",
"transforms.SetSchemaMetadata.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value",
"transforms.SetSchemaMetadata.schema.name": "avro"

This will set the schema name for the value message field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM