robertwb commented on code in PR #29160:
URL: https://github.com/apache/beam/pull/29160#discussion_r1378275236
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaWriteSchemaTransformProvider.java:
##########
@@ -131,10 +132,18 @@ public void finish() {
@Override
public PCollectionRowTuple expand(PCollectionRowTuple input) {
Schema inputSchema = input.get("input").getSchema();
- final SerializableFunction<Row, byte[]> toBytesFn =
- configuration.getFormat().equals("JSON")
- ? JsonUtils.getRowToJsonBytesFunction(inputSchema)
- : AvroUtils.getRowToAvroBytesFunction(inputSchema);
+ final SerializableFunction<Row, byte[]> toBytesFn;
+ if (configuration.getFormat().equals("RAW")) {
+ int numFields = inputSchema.getFields().size();
+ if (numFields != 1) {
Review Comment:
We can do this as a follow-up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]