[
https://issues.apache.org/jira/browse/BEAM-12730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429461#comment-17429461
]
Eugene Nikolaiev commented on BEAM-12730:
-----------------------------------------
There seems to be a potential issue of skipped multi-byte delimiters - see my
comment in PR: [https://github.com/apache/beam/pull/15667#discussion_r730046514]
Also, default for the delimiter and behavior in case of {{b'\n'}} delimiter is
different from Java SDK's TextIO:
* default: Java - null, Python - {{b'\n'}}
* If {{b'\n'}} is requested explicitly: Java - splits on {{'\n'}} only, Python
- also splits on {{b'\r\n'}} in this case (no way to request splitting on
{{b'\n'}} only)
> Add custom delimiters to Python TextIO reads
> --------------------------------------------
>
> Key: BEAM-12730
> URL: https://issues.apache.org/jira/browse/BEAM-12730
> Project: Beam
> Issue Type: New Feature
> Components: io-py-common, io-py-files
> Reporter: Daniel Oliveira
> Assignee: Dmitrii Kuzin
> Priority: P2
> Labels: beginner, newbie, starter
> Time Spent: 7h
> Remaining Estimate: 0h
>
> A common request by users is to be able to separate a text files read by
> TextIO with delimiters other than newline. The Java SDK already supports this
> feature.
> The current delimiter code is [located
> here|https://github.com/apache/beam/blob/v2.31.0/sdks/python/apache_beam/io/textio.py#L236]
> and defaults to newlines. This function could easily be modified to also
> handle custom delimiters. Changing this would also necessitate changing the
> API for the various TextIO.Read methods and adding documentation.
> This seems like a good starter bug for making more in-depth contributions to
> Beam Python.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)