serratedserenade commented on issue #35363: URL: https://github.com/apache/beam/issues/35363#issuecomment-2998398294
> Doesn't `shard_name_template` work for you? No, what I like about `WriteToFiles` is that you can make the files go to different outputs based on the record being written e.g. if I wanted all records with `event: a` being written to `gs://bucket/events/a`. With `WriteToText` I have to hardcode the specific folder with `file_path_prefix` which only either takes a string or callable. And according to the [documentation](https://beam.apache.org/releases/pydoc/current/apache_beam.io.textio.html#apache_beam.io.textio.WriteToText): `shard_name_template ([str](https://docs.python.org/3/library/stdtypes.html#str)) – A template string containing placeholders for the shard number and shard count. Currently only '' and '-SSSSS-of-NNNNN' are patterns accepted by the service. When constructing a filename for a particular shard number, the upper-case letters S and N are replaced with the 0-padded shard number and shard count respectively. This argument can be '' in which case it behaves as if num_shards was set to 1 and only one file will be generated. The default pattern used is '-SSSSS-of-NNNNN'.` Doesn't seem to work either. -- 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-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org