Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Current state: Under Discussion

Discussion thread: https://lists.apache.org/thread/3hkd9lljobf9rl56ogjpcbo4ldoxcz5nhere [Change the link from the KIP proposal email archive to your own email thread]

JIRA: KAFKA-7883

Pull request changes: https://github.com/apache/kafka/pull/11442/files

Motivation

SetSchemaMetadata SMT doesn’t support transformation of the source schema namespace separately from the schema name transformation. When using Kafka Connect and Avro Converter with Schema Registry you may have to transform your source schema namespace independently from the schema name(s). Another use-case as mentioned in KAFKA-7883, when use JDBC connector with multiple tables in the source database you may have to preserve the original table names but only specify some non-empty namespace for them.

...

From the perspective of Kafka Connevct Connect SMT configuration it looks like adding of a new optional attribute "transforms.transformschema.schema.namenamespace" optional attribute:

{
"transforms" : "TransformSchema",
"transforms.TransformSchema.type" : "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value",
"transforms.TransformSchema.schema.namespace" : "my.new.namespace",
"transforms.transformschema.schema.name" : "NewSchemaName",
"transforms.TransformSchema.schema.version" : 42
}

Proposed Changes

Add Adding of a new schema.namespace attribute to SetSchemaMetadata SMT letting developer to decide either to transform namespace only or transform both schema name and schema namespace by using either schema.namespace together with schema.name or name or just single schemasingle schema.name attribute.

...

name attribute. In SetSchemaMetadata class we should concatenate values from schema.namespace and schema.name while we also should keep backward compatibility and leave all schema.namespace, schema.

...

name and schema.version parameters optional.

Compatibility, Deprecation, and Migration Plan

The added "transforms.transformschema.schema.namespace" option's default value isshould be null , to be compatible with the old behavior.

...