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:35:11 UTC

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

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



##########
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:
       That's assuming a reasonably uniform distribution of file sizes though. Then again, millions of small files and a small number of TB-sized file is probably an equally remote possibility.




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