Daniel Urban created KAFKA-14716:
------------------------------------
Summary: Connect schema does not allow struct default values
Key: KAFKA-14716
URL: https://issues.apache.org/jira/browse/KAFKA-14716
Project: Kafka
Issue Type: Bug
Reporter: Daniel Urban
Assignee: Daniel Urban
The ConnectSchema API should allow specifying a composite (struct) default
value for a field, but with the current API, it is impossible to do so.
# There is a circular dependency between creating a struct as a default value
and creating the schema which holds it as the default value. The Struct
constructor expects a Schema object, and the default value setter of
SchemaBuilder checks schema conformity by using the
ConnectSchema.validateValue, which in turn uses ConnectSchema.equals. This can
only be bypassed if the struct references a SchemaBuilder instance, and
defaultValue is called on that builder instance, but this goes against the
Struct docs stating that "Struct objects must specify a complete \{@link
Schema} up front".
# ConnectSchema.equals is not prepared to be used with other Schema
implementations, so equals checks between ConnectSchema and SchemaBuilder
instances will always fail. This is only causing an issue if equals has to be
used for schema conformity checks.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)