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

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

                Author: ASF GitHub Bot
            Created on: 28/Sep/20 16:59
            Start Date: 28/Sep/20 16:59
    Worklog Time Spent: 10m 
      Work Description: aromanenko-dev commented on a change in pull request 
#12572:
URL: https://github.com/apache/beam/pull/12572#discussion_r496100066



##########
File path: 
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -1620,14 +1635,43 @@ public void processElement(
       CoderRegistry coderRegistry = input.getPipeline().getCoderRegistry();
       Coder<K> keyCoder = getKeyCoder(coderRegistry);
       Coder<V> valueCoder = getValueCoder(coderRegistry);
-      Coder<KafkaRecord<K, V>> outputCoder = KafkaRecordCoder.of(keyCoder, 
valueCoder);
-      PCollection<KafkaRecord<K, V>> output =
-          input.apply(ParDo.of(new ReadFromKafkaDoFn<K, 
V>(this))).setCoder(outputCoder);
-      // TODO(BEAM-10123): Add CommitOffsetTransform to expansion.
-      if (isCommitOffsetEnabled() && !configuredKafkaCommit()) {
-        throw new IllegalStateException("Offset committed is not supported 
yet");
+      Coder<KafkaRecord<K, V>> recordCoder = KafkaRecordCoder.of(keyCoder, 
valueCoder);
+
+      try {
+        PCollection<KV<KafkaSourceDescriptor, KafkaRecord<K, V>>> 
outputWithDescriptor =
+            input
+                .apply(ParDo.of(new ReadFromKafkaDoFn<K, V>(this)))
+                .setCoder(
+                    KvCoder.of(
+                        input
+                            .getPipeline()
+                            .getSchemaRegistry()
+                            .getSchemaCoder(KafkaSourceDescriptor.class),
+                        recordCoder));
+        if (isCommitOffsetEnabled() && !configuredKafkaCommit()) {
+          outputWithDescriptor =
+              outputWithDescriptor
+                  .apply(Reshuffle.viaRandomKey())

Review comment:
       Why do we need `Reshuffle`? Won't it affect a performance? 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 492071)
    Time Spent: 0.5h  (was: 20m)

> Create CommitOffsetTransform to commit Kafka record offset
> ----------------------------------------------------------
>
>                 Key: BEAM-10123
>                 URL: https://issues.apache.org/jira/browse/BEAM-10123
>             Project: Beam
>          Issue Type: Sub-task
>          Components: io-java-kafka
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: P3
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to