You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/03/03 18:44:00 UTC

[jira] [Work logged] (BEAM-10529) Kafka XLang fails for ?empty? key/values

     [ https://issues.apache.org/jira/browse/BEAM-10529?focusedWorklogId=736216&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-736216 ]

ASF GitHub Bot logged work on BEAM-10529:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Mar/22 18:43
            Start Date: 03/Mar/22 18:43
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on a change in pull request #16923:
URL: https://github.com/apache/beam/pull/16923#discussion_r818961014



##########
File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -776,11 +777,11 @@ private static Coder resolveCoder(Class deserializer) {
               continue;
             }
             if (returnType.equals(byte[].class)) {
-              return ByteArrayCoder.of();
+              return NullableCoder.of(ByteArrayCoder.of());
             } else if (returnType.equals(Integer.class)) {
-              return VarIntCoder.of();
+              return NullableCoder.of(VarIntCoder.of());
             } else if (returnType.equals(Long.class)) {
-              return VarLongCoder.of();
+              return NullableCoder.of(VarLongCoder.of());

Review comment:
       Agreed that would be the best solution, but to be clear, are you planning on doing that for the next step on this PR?




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 736216)
    Time Spent: 3h  (was: 2h 50m)

> Kafka XLang fails for ?empty? key/values
> ----------------------------------------
>
>                 Key: BEAM-10529
>                 URL: https://issues.apache.org/jira/browse/BEAM-10529
>             Project: Beam
>          Issue Type: Bug
>          Components: cross-language, io-java-kafka
>            Reporter: Luke Cwik
>            Assignee: John Casey
>            Priority: P1
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> It looks like the Javadoc for ByteArrayDeserializer and StringDeserializer can return null[1, 2] and we aren't using NullableCoder.of(ByteArrayCoder.of()) in the expansion[3]. Note that KafkaIO does this correctly in its regular coder inference logic[4].
> 1: [https://kafka.apache.org/21/javadoc/org/apache/kafka/common/serialization/ByteArrayDeserializer.html#deserialize-java.lang.String-byte:A-|https://kafka.apache.org/21/javadoc/org/apache/kafka/common/serialization/ByteArrayDeserializer.html#deserialize-java.lang.String-byte:A-2:]
> [2:|https://kafka.apache.org/21/javadoc/org/apache/kafka/common/serialization/ByteArrayDeserializer.html#deserialize-java.lang.String-byte:A-2:]
>  [https://kafka.apache.org/21/javadoc/org/apache/kafka/common/serialization/StringDeserializer.html#deserialize-java.lang.String-byte:A-]
> 3: [https://github.com/apache/beam/blob/af2d6b0379d64b522ecb769d88e9e7e7b8900208/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java#L478]
> 4: [https://github.com/apache/beam/blob/af2d6b0379d64b522ecb769d88e9e7e7b8900208/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java#L85]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)