chamikaramj commented on a change in pull request #15126:
URL: https://github.com/apache/beam/pull/15126#discussion_r687078276
##########
File path: sdks/python/apache_beam/io/filebasedsource.py
##########
@@ -377,8 +382,12 @@ def process(self, element, *args, **kwargs):
if not source_list:
return
source = source_list[0].source
- for record in source.read(range.new_tracker()):
- yield record
+
+ if self._with_filename:
+ return [(metadata.path, record)
+ for record in source.read(range.new_tracker())]
+ else:
+ return [record for record in source.read(range.new_tracker())]
Review comment:
Yeah, I think this could still result in OOMs (we are putting all
elements to a list before returning).
--
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]