[
https://issues.apache.org/jira/browse/BEAM-4062?focusedWorklogId=92425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-92425
]
ASF GitHub Bot logged work on BEAM-4062:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Apr/18 06:36
Start Date: 19/Apr/18 06:36
Worklog Time Spent: 10m
Work Description: chamikaramj commented on a change in pull request
#5158: [BEAM-4062] Fix performance regression in FileBasedSink.
URL: https://github.com/apache/beam/pull/5158#discussion_r182645509
##########
File path: sdks/python/apache_beam/io/filebasedsink.py
##########
@@ -309,11 +341,18 @@ def _template_to_format(shard_name_template):
shard_name_template)
shard_name_format = shard_name_template.replace(
m.group(0), '%%(shard_num)0%dd' % len(m.group(0)))
- m = re.search('N+', shard_name_format)
- if m:
- shard_name_format = shard_name_format.replace(
- m.group(0), '%%(num_shards)0%dd' % len(m.group(0)))
- return shard_name_format
+ return FileBasedSink._template_replace_num_shards(shard_name_format)
+
+ @staticmethod
+ def _template_to_glob_format(shard_name_template):
+ if not shard_name_template:
+ return ''
+ m = re.search('S+', shard_name_template)
+ if m is None:
+ raise ValueError("Shard number pattern S+ not found in template '%s'" %
Review comment:
Not sure if this error message is useful for an end-user since it might not
be immediately clear what S+ is. Can we elaborate more ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 92425)
Time Spent: 1h (was: 50m)
> Performance regression in FileBasedSink
> ---------------------------------------
>
> Key: BEAM-4062
> URL: https://issues.apache.org/jira/browse/BEAM-4062
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Udi Meiri
> Assignee: Udi Meiri
> Priority: Blocker
> Fix For: 2.5.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> [https://github.com/apache/beam/pull/4648] has added:
> * 3 or more stat() calls per output file (in pre_finalize and
> finalize_writes)
> * serial unbatched delete()s (in pre_finalize)
> Solution will be to list files in a batch operation (match()), and to
> delete() in batch mode, or use multiple threads if that's not possible.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)