Abacn commented on code in PR #34324:
URL: https://github.com/apache/beam/pull/34324#discussion_r2001303720


##########
sdks/python/apache_beam/io/gcp/bigquery_file_loads.py:
##########
@@ -1313,3 +1312,9 @@ def expand(self, pcoll):
         self.DESTINATION_FILE_PAIRS: all_destination_file_pairs_pc,
         self.DESTINATION_COPY_JOBID_PAIRS: destination_copy_job_ids_pc,
     }
+
+
+class KeyByPaneIndex(beam.DoFn):
+  def process(self, element, pane_info=beam.DoFn.PaneInfoParam):
+    destination, (partition_key, files) = element
+    return [(destination, (partition_key, files, pane_info.index))]

Review Comment:
   One of the original concern was upgrade compatibility. However because a 
ReShuffle is needed, pipeline graph will be changed anyways



##########
sdks/python/apache_beam/io/gcp/bigquery_file_loads.py:
##########
@@ -1313,3 +1312,9 @@ def expand(self, pcoll):
         self.DESTINATION_FILE_PAIRS: all_destination_file_pairs_pc,
         self.DESTINATION_COPY_JOBID_PAIRS: destination_copy_job_ids_pc,
     }
+
+
+class KeyByPaneIndex(beam.DoFn):
+  def process(self, element, pane_info=beam.DoFn.PaneInfoParam):
+    destination, (partition_key, files) = element
+    return [(destination, (partition_key, files, pane_info.index))]

Review Comment:
   One of the original concern was upgrade compatibility. However because a 
ReShuffle is added here, pipeline graph will be changed anyways



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

Reply via email to