Description
This article discusses how to troubleshoot the error below with a fully managed S3 Source Connector
There is an illegal character in the schema field. Please ensure the schema has valid characters in it
Applies To
Amazon S3 Source Connector
Confluent Cloud
Cause
The error message indicates that there is an illegal character in one or more of schema field(s) name
Resolution
-
Identify the Illegal Character and the Field: The error message indicates that there is an illegal character in the schema field name. Avro schema field names must start with a letter or an underscore and can only contain letters, digits, and underscores. Ensure that the all field names in your schema adhere to these field naming rules. For example, field names should not start with numerics or contain special characters like dashes.
-
ReplaceField SMT: Use the ReplaceField Single Message Transform (SMT) to rename fields with invalid characters. For example, to replace a field named "1branch-name" with "branchname", you can use the following configuration:
"transforms": "RenameField", "transforms.RenameField.type": "org.apache.kafka.connect.transforms.ReplaceField$Value", "transforms.RenameField.renames": "1branch-name:branchname"
For more details on using SMTs, refer to the Confluent documentation: ReplaceField SMT
By following these steps, you should be able to resolve the "Illegal character" error in your Avro schema.