[ 
https://issues.apache.org/jira/browse/BEAM-7925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17161255#comment-17161255
 ] 

Neville Li commented on BEAM-7925:
----------------------------------

No that would only work if all un-projected fields are nullable i.e. with 
{{"type": ["null", "SomeType"], "default": null}} in the schema.
Otherwise the result Avro records will not survive serialization. That's why 
our Parquet Avro IO requires an extra {{projectionFn}} that maps incomplete 
Avro into a user type {{T}}, most commonly a case class.

Also Avro is just one of the many supported in-memory representation for 
Parquet. Ideally a generic and actually useful Parquet IO should support 
different {{Parquet{Read,Write}Support<T>}} classes and composable. But yeah 
each format (thrift, Protobuf, etc.) might impose some challengages.

> ParquetIO supports neither column projection nor filter predicate
> -----------------------------------------------------------------
>
>                 Key: BEAM-7925
>                 URL: https://issues.apache.org/jira/browse/BEAM-7925
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-parquet
>    Affects Versions: 2.14.0
>            Reporter: Neville Li
>            Priority: P2
>
> Current {{ParquetIO}} supports neither column projection nor filter predicate 
> which defeats the performance motivation of using Parquet in the first place. 
> That's why we have our own implementation of 
> [ParquetIO|https://github.com/spotify/scio/tree/master/scio-parquet/src] in 
> Scio.
> Reading Parquet as Avro with column projection has some complications, 
> namely, the resulting Avro records may be incomplete and will not survive 
> ser/de. A workaround maybe provide a {{TypedRead}} interface that takes a 
> {{Function<A, B>}} that maps invalid Avro {{A}} into user defined type {{B}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to