[
https://issues.apache.org/jira/browse/BEAM-14315?focusedWorklogId=776536&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-776536
]
ASF GitHub Bot logged work on BEAM-14315:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 31/May/22 20:10
Start Date: 31/May/22 20:10
Worklog Time Spent: 10m
Work Description: Abacn commented on code in PR #17604:
URL: https://github.com/apache/beam/pull/17604#discussion_r886088987
##########
sdks/python/apache_beam/io/avroio.py:
##########
@@ -176,20 +181,70 @@ def __init__(
name and the value being the actual data. If False, it only returns
the data.
"""
- source_from_file = partial(
+ self._source_from_file = partial(
_create_avro_source, min_bundle_size=min_bundle_size)
- self._read_all_files = filebasedsource.ReadAllFiles(
+ self._desired_bundle_size = desired_bundle_size
+ self._min_bundle_size = min_bundle_size
+ self._with_filename = with_filename
+ self.label = label
+
+ def _set_read_all_files(self):
+ """Helper function to set _read_all_files PTransform in constructor."""
+ return filebasedsource.ReadAllFiles(
True,
CompressionTypes.AUTO,
- desired_bundle_size,
- min_bundle_size,
- source_from_file,
- with_filename)
-
- self.label = label
+ self._desired_bundle_size,
+ self._min_bundle_size,
+ self._source_from_file,
+ self._with_filename)
def expand(self, pvalue):
- return pvalue | self.label >> self._read_all_files
+ return pvalue | self.label >> self._set_read_all_files()
+
+
+class ReadAllFromAvroContinuously(ReadAllFromAvro):
+ """A ``PTransform`` for reading avro files in given file patterns.
+ This PTransform acts as a Source and produces continuously a ``PCollection``
+ of strings.
+
+ For more details, see ``ReadAllFromAvro`` for avro parsing settings;
+ see ``apache_beam.io.fileio.MatchContinuously`` for watching settings.
+
+ ReadAllFromAvroContinuously is experimental. No backwards-compatibility
+ guarantees. Due to the limitation on Reshuffle, current implementation does
Review Comment:
Mentioned.
Issue Time Tracking
-------------------
Worklog Id: (was: 776536)
Time Spent: 2h 40m (was: 2.5h)
> 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 40m
> 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)