Yash Mayya created KAFKA-16196:
----------------------------------
Summary: Cast transform doesn't handle invalid whole value casts
gracefully
Key: KAFKA-16196
URL: https://issues.apache.org/jira/browse/KAFKA-16196
Project: Kafka
Issue Type: Bug
Components: connect
Reporter: Yash Mayya
Assignee: Yash Mayya
The Cast transform currently doesn't handle invalid whole value casts
gracefully. A whole value cast is configured like {{{"spec": "int8"}}} as
opposed to a field level cast like {{{}{"spec": "field1:int8"{}}}}.
If an invalid field level cast is specified (for instance - {{{}{"spec":
"field1:invalid"{}}}}), this results in a {{ConfigException}} being thrown here
-
[https://github.com/apache/kafka/blob/5f410ceb04878ca44d2d007655155b5303a47907/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java#L416]
which is handled gracefully as a validation error here -
[https://github.com/apache/kafka/blob/5f410ceb04878ca44d2d007655155b5303a47907/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java#L605-L609]
However, invalid whole value casts aren't handled appropriately and result in
an
{{IllegalArgumentException}} being thrown, which surfaces as an uncaught
exception and a {{500 Internal Server Error}} response from the connector
create / update / config validation REST API endpoint.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)