[ 
https://issues.apache.org/jira/browse/BEAM-14315?focusedWorklogId=774750&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-774750
 ]

ASF GitHub Bot logged work on BEAM-14315:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/May/22 18:18
            Start Date: 25/May/22 18:18
    Worklog Time Spent: 10m 
      Work Description: Abacn commented on code in PR #17604:
URL: https://github.com/apache/beam/pull/17604#discussion_r881976544


##########
sdks/python/apache_beam/io/filebasedsource.py:
##########
@@ -338,15 +338,25 @@ def default_output_coder(self):
 
 class _ExpandIntoRanges(DoFn):
   def __init__(
-      self, splittable, compression_type, desired_bundle_size, 
min_bundle_size):
+      self,
+      splittable,
+      compression_type,
+      desired_bundle_size,
+      min_bundle_size,
+      do_match=True):
     self._desired_bundle_size = desired_bundle_size
     self._min_bundle_size = min_bundle_size
     self._splittable = splittable
     self._compression_type = compression_type
+    self._do_match = do_match
 
   def process(self, element, *args, **kwargs):
-    match_results = FileSystems.match([element])
-    for metadata in match_results[0].metadata_list:
+    if self._do_match:

Review Comment:
   Here the passed in parameters can be either filename or FileMetadata. If 
FileMetadata is passed in then need not to do a match again. 
   
   Should be able to eliminate the _do_match flag and simply check with 
isinstance(...) at run time. Also should add type hint for process method.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 774750)
    Time Spent: 2h  (was: 1h 50m)

> Update fileio.MatchContinuously to allow reading already read files with a 
> new timestamp
> ----------------------------------------------------------------------------------------
>
>                 Key: BEAM-14315
>                 URL: https://issues.apache.org/jira/browse/BEAM-14315
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-py-common
>            Reporter: Yi Hu
>            Assignee: Yi Hu
>            Priority: P2
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> This will be the Python counterpart of BEAM-14267.
> For fileio.MatchContinuously, we want to add an option to choose to consider 
> a file new if it has a different timestamp from an existing file, even if the 
> file itself has the same name.
> See the following design doc for more detail:
> https://docs.google.com/document/d/1xnacyLGNh6rbPGgTAh5D1gZVR8rHUBsMMRV3YkvlL08/edit?usp=sharing&resourcekey=0-be0uF-DdmwAz6Vg4Li9FNw



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to