You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/10/28 00:14:31 UTC

[GitHub] [beam] rezarokni commented on a change in pull request #13198: [BEAM-10124] Compute number of records before each offset using a Multimap sideinput keyed with a filename.

rezarokni commented on a change in pull request #13198:
URL: https://github.com/apache/beam/pull/13198#discussion_r513105372



##########
File path: sdks/java/io/contextualtextio/src/main/java/org/apache/beam/sdk/io/contextualtextio/ContextualTextIO.java
##########
@@ -476,37 +478,53 @@ public void processElement(ProcessContext p) {
             if (pastRecords.containsKey(file)) {
               numRecordsBefore = pastRecords.get(file);
             }
-            p.output(KV.of(fileRange, numRecordsBefore));
+            p.output(KV.of(file, KV.of(fileRange.getValue(), numRecordsBefore)));
             pastRecords.put(file, numRecordsBefore + numRecords);
           }
         }
       }
     }
 
     static class AssignRecordNums extends DoFn<KV<KV<String, Long>, Row>, Row> {

Review comment:
       As discussed , please add more comments on AssignRecordNums in next commit.




----------------------------------------------------------------
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:
users@infra.apache.org