ahmedabu98 commented on code in PR #30045:
URL: https://github.com/apache/beam/pull/30045#discussion_r1459880528
##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -2244,18 +2250,65 @@ def find_in_nested_dict(schema):
table = bigquery_tools.get_hashable_destination(self.table_reference)
# None type is not supported
triggering_frequency = self.triggering_frequency or 0
- # SchemaTransform expects Beam Rows, so map to Rows first
- if is_rows:
- input_beam_rows = pcoll
- else:
- input_beam_rows = (
+
+ # For dynamic destinations, we first figure out where each row is going.
+ # Then we append the destination to each row before sending it over to
+ # the Java SchemaTransform.
+ # We need to do this here because there are obstacles to passing the
+ # destinations function to Java
+ if callable(table):
Review Comment:
Good call, I can put all this logic in a new PTransform class similar to the
other write methods
--
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]