[
https://issues.apache.org/jira/browse/BEAM-14236?focusedWorklogId=753783&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753783
]
ASF GitHub Bot logged work on BEAM-14236:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Apr/22 23:50
Start Date: 06/Apr/22 23:50
Worklog Time Spent: 10m
Work Description: Shiv22Wabale commented on code in PR #17279:
URL: https://github.com/apache/beam/pull/17279#discussion_r844522034
##########
sdks/python/apache_beam/io/parquetio_test.py:
##########
@@ -314,6 +348,28 @@ def test_sink_transform(self):
| Map(json.dumps)
assert_that(readback, equal_to([json.dumps(r) for r in self.RECORDS]))
+ def test_sink_transform_compliant_nested_type(self):
+ if ARROW_MAJOR_VERSION < 4:
+ return unittest.skip(
+ 'Writing with compliant nested type is only '
+ 'supported in pyarrow 4.x and above')
+ with TemporaryDirectory() as tmp_dirname:
+ path = os.path.join(tmp_dirname + 'tmp_filename')
+ with TestPipeline() as p:
+ _ = p \
+ | Create(self.RECORDS_NESTED) \
+ | WriteToParquet(
+ path, self.SCHEMA_NESTED, num_shards=1,
+ shard_name_template='', use_compliant_nested_type=True)
+ with TestPipeline() as p:
+ # json used for stable sortability
+ readback = \
+ p \
+ | ReadFromParquet(path) \
Review Comment:
We just need it for writer.
The ReadFromParquet would just use the schema in the parquet file and
doesn't require any external indicator/flag to read the parquet with compliant
nested fields.
And we'll be using different consumer other than ReadFromParquet but I don't
think we need any changes from reader side.
Issue Time Tracking
-------------------
Worklog Id: (was: 753783)
Time Spent: 3h 10m (was: 3h)
> [Python] Write to Parquet support for list to conform with Apache Parquet
> specification
> ---------------------------------------------------------------------------------------
>
> Key: BEAM-14236
> URL: https://issues.apache.org/jira/browse/BEAM-14236
> Project: Beam
> Issue Type: Bug
> Components: io-py-parquet
> Reporter: Shivraj Devidas Wabale
> Assignee: Shivraj Devidas Wabale
> Priority: P2
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> ARROW-11497 The pyarrow parquet writer now support the list type contains 3
> level where the middle level, named {{{}list{}}}, must be a repeated group
> with a single field named _{{element.
> [https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#lists|https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#lists,]}}_
> I think we can simply populate it to [WriteToParquet
> |https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/parquetio.py#L358]by
> adding additional flag (use_compliant_nested_type) to
> conform with Apache Parquet specification.
> h4.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)