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

ASF GitHub Bot logged work on BEAM-7925:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Sep/20 00:18
            Start Date: 09/Sep/20 00:18
    Worklog Time Spent: 10m 
      Work Description: danielxjd commented on a change in pull request #12786:
URL: https://github.com/apache/beam/pull/12786#discussion_r485264174



##########
File path: 
sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java
##########
@@ -299,9 +344,14 @@ public ReadFiles withSplit() {
     public PCollection<GenericRecord> expand(PCollection<FileIO.ReadableFile> 
input) {
       checkNotNull(getSchema(), "Schema can not be null");
       if (isSplittable()) {
+        if (getProjection() == null) {

Review comment:
       Changed.

##########
File path: 
sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java
##########
@@ -279,6 +312,10 @@ public void populateDisplayData(DisplayData.Builder 
builder) {
 
       abstract Builder setAvroDataModel(GenericData model);
 
+      abstract Builder setProjectionEncoder(Schema schema);
+
+      abstract Builder setProjection(Schema schema);

Review comment:
       Changed

##########
File path: 
sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java
##########
@@ -269,6 +298,10 @@ public void populateDisplayData(DisplayData.Builder 
builder) {
 
     abstract @Nullable GenericData getAvroDataModel();
 
+    abstract @Nullable Schema getProjectionEncoder();
+
+    abstract @Nullable Schema getProjection();

Review comment:
       Changed.

##########
File path: 
sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java
##########
@@ -209,6 +223,10 @@ public static ReadFiles readFiles(Schema schema) {
 
       abstract Builder setSchema(Schema schema);
 
+      abstract Builder setProjectionEncoder(Schema schema);
+
+      abstract Builder setProjection(Schema schema);

Review comment:
       Changed.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 480503)
    Time Spent: 1h 50m  (was: 1h 40m)

> 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
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> 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