[
https://issues.apache.org/jira/browse/BEAM-6211?focusedWorklogId=191285&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-191285
]
ASF GitHub Bot logged work on BEAM-6211:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Jan/19 22:17
Start Date: 28/Jan/19 22:17
Worklog Time Spent: 10m
Work Description: chamikaramj commented on pull request #7253:
[BEAM-6211] Support deflate (zlib) in CompressedFile
URL: https://github.com/apache/beam/pull/7253#discussion_r251617917
##########
File path: sdks/python/apache_beam/io/textio_test.py
##########
@@ -641,6 +654,82 @@ def test_read_bzip2_concat(self):
assert_that(lines, equal_to(expected))
pipeline.run()
+ def test_read_deflate(self):
+ _, lines = write_data(15)
+ with TempDir() as tempdir:
+ file_name = tempdir.create_temp_file()
+ with open(file_name, 'wb') as f:
+ f.write(zlib.compress('\n'.join(lines)))
+
+ pipeline = TestPipeline()
+ pcoll = pipeline | 'Read' >> ReadFromText(
+ file_name,
+ 0, CompressionTypes.DEFLATE,
+ True, coders.StrUtf8Coder())
+ assert_that(pcoll, equal_to(lines))
+ pipeline.run()
+
Review comment:
Please add tests for text sink (textio.WriteToText) as well.
----------------------------------------------------------------
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: 191285)
Time Spent: 1h 10m (was: 1h)
> Support deflate (zlib) in CompressedFile
> ----------------------------------------
>
> Key: BEAM-6211
> URL: https://issues.apache.org/jira/browse/BEAM-6211
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Brian Martin
> Assignee: Brian Martin
> Priority: Minor
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> `.deflate` files are quite common in Hadoop and also supported by TensorFlow
> in TFRecord file format. Moreover, `.deflate` is supported by the java SDK
> (see BEAM-1518).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)