Describe the bug
Stream created using value_schema_id for protobuf schema fails to deserialise records when used in join
See illustration below.
first_stream_2 is created without value_schema_id, first_stream is created using VALUE_SCHEMA_ID
ksql> select `FIELD1` from first_stream_2 s1 LEFT JOIN country_table t1 ON t1.FIELD1 = s1.FIELD2 emit changes;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|FIELD1 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|1 |
^CQuery terminated
ksql> select `FIELD1` from first_stream s1 LEFT JOIN country_table t1 ON t1.FIELD1 = s1.FIELD2 emit changes;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|FIELD1 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Error in processing query. Check server logs for details.
Query terminated
ksql> select `FIELD1` from first_stream_2 s1 LEFT JOIN country_table t1 ON t1.FIELD1 = s1.FIELD2 emit changes;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|FIELD1 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|1 |
^CQuery terminated
ksql> select `FIELD1` from first_stream s1 LEFT JOIN country_table t1 ON t1.FIELD1 = s1.FIELD2 emit changes;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|FIELD1 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Error in processing query. Check server logs for details.
Query terminated
Expected behavior
Both joins should emit records
Actual behaviour
Only the join using stream created without VALUE_SCHEMA_ID emits records
Additional context
The join using stream with VALUE_SCHEMA_ID fails in repartition stream
Caused by: org.apache.kafka.common.errors.SerializationException: Error serializing message to topic: _confluent-ksql-stdalonetransient_transient_S1_2748697664827909033_1654093227745-Join-repartition. Schema from Schema Registry misses field with name: S1_FIELD1
at io.confluent.ksql.serde.connect.KsqlConnectSerializer.serialize(KsqlConnectSerializer.java:56)
at io.confluent.ksql.serde.tls.ThreadLocalSerializer.serialize(ThreadLocalSerializer.java:37)
at io.confluent.ksql.serde.connect.ConnectFormat$ListToStructSerializer.serialize(ConnectFormat.java:186)
at io.confluent.ksql.serde.connect.ConnectFormat$ListToStructSerializer.serialize(ConnectFormat.java:149)
at io.confluent.ksql.serde.GenericSerializer.serialize(GenericSerializer.java:62)
at io.confluent.ksql.logging.processing.LoggingSerializer.serialize(LoggingSerializer.java:47)
at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62)
at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:157)
... 38 more
Describe the bug Stream created using value_schema_id for protobuf schema fails to deserialise records when used in join See illustration below. first_stream_2 is created without value_schema_id, first_stream is created using VALUE_SCHEMA_ID
To Reproduce Register schema
Create a table for RHS and produce a key that is going to match the event column used in join
Produce a message
Create streams
Create a join
Expected behavior Both joins should emit records
Actual behaviour Only the join using stream created without VALUE_SCHEMA_ID emits records
Additional context The join using stream with VALUE_SCHEMA_ID fails in repartition stream