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 2021/11/29 19:04:53 UTC

[GitHub] [beam] robertwb commented on a change in pull request #16066: [BEAM-13335] Use shorter, numerical indices for dataframe reads.

robertwb commented on a change in pull request #16066:
URL: https://github.com/apache/beam/pull/16066#discussion_r758655094



##########
File path: sdks/python/apache_beam/dataframe/io.py
##########
@@ -521,10 +535,15 @@ def create_tracker(self, restriction):
       return beam.io.restriction_trackers.UnsplittableRestrictionTracker(
           tracker)
 
-  def process(self, readable_file, tracker=beam.DoFn.RestrictionParam()):
+  def process(
+      self, readable_file, path_indices, tracker=beam.DoFn.RestrictionParam()):
     reader = self.reader
     if isinstance(reader, str):
       reader = getattr(pd, self.reader)
+    start_index = (
+        tracker.current_restriction().start +
+        path_indices[readable_file.metadata.path] *
+        10**int(math.log(2**64 // len(path_indices), 10)))

Review comment:
       This becomes an error in the exabyte range (e.g. millions of TB-sized files). That's probably a ways off, but just in case I added a check. 




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org