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

ASF GitHub Bot commented on PARQUET-1183:
-----------------------------------------

rdblue closed pull request #460: PARQUET-1183: Add Avro builders using 
InputFile and OutputFile.
URL: https://github.com/apache/parquet-mr/pull/460
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetReader.java 
b/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetReader.java
index a361c62fd..442c5b78f 100644
--- a/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetReader.java
+++ b/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetReader.java
@@ -28,16 +28,25 @@
 import org.apache.parquet.filter.UnboundRecordFilter;
 import org.apache.parquet.hadoop.ParquetReader;
 import org.apache.parquet.hadoop.api.ReadSupport;
+import org.apache.parquet.io.InputFile;
 
 /**
  * Read Avro records from a Parquet file.
  */
 public class AvroParquetReader<T> extends ParquetReader<T> {
 
+  /**
+   * @deprecated will be removed in 2.0.0; use {@link #builder(InputFile)} 
instead.
+   */
+  @Deprecated
   public static <T> Builder<T> builder(Path file) {
     return new Builder<T>(file);
   }
 
+  public static <T> Builder<T> builder(InputFile file) {
+    return new Builder<T>(file);
+  }
+
   /**
    * @deprecated use {@link #builder(Path)}
    */
@@ -76,10 +85,15 @@ public AvroParquetReader(Configuration conf, Path file, 
UnboundRecordFilter unbo
     private boolean enableCompatibility = true;
     private boolean isReflect = true;
 
+    @Deprecated
     private Builder(Path path) {
       super(path);
     }
 
+    private Builder(InputFile file) {
+      super(file);
+    }
+
     public Builder<T> withDataModel(GenericData model) {
       this.model = model;
 
diff --git 
a/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetWriter.java 
b/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetWriter.java
index d0c063325..3e802a84f 100644
--- a/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetWriter.java
+++ b/parquet-avro/src/main/java/org/apache/parquet/avro/AvroParquetWriter.java
@@ -28,6 +28,7 @@
 import org.apache.parquet.hadoop.ParquetWriter;
 import org.apache.parquet.hadoop.api.WriteSupport;
 import org.apache.parquet.hadoop.metadata.CompressionCodecName;
+import org.apache.parquet.io.OutputFile;
 
 /**
  * Write Avro records to a Parquet file.
@@ -38,6 +39,10 @@
     return new Builder<T>(file);
   }
 
+  public static <T> Builder<T> builder(OutputFile file) {
+    return new Builder<T>(file);
+  }
+
   /** Create a new {@link AvroParquetWriter}.
    *
    * @param file
@@ -153,6 +158,10 @@ private Builder(Path file) {
       super(file);
     }
 
+    private Builder(OutputFile file) {
+      super(file);
+    }
+
     public Builder<T> withSchema(Schema schema) {
       this.schema = schema;
       return this;


 

----------------------------------------------------------------
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:
us...@infra.apache.org


> AvroParquetWriter needs OutputFile based Builder
> ------------------------------------------------
>
>                 Key: PARQUET-1183
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1183
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-avro
>    Affects Versions: 1.9.1
>            Reporter: Werner Daehn
>            Priority: Major
>             Fix For: 1.10.0
>
>
> The ParquetWriter got a new Builder(OutputFile). 
> But it cannot be used by the AvroParquetWriter as there is no matching 
> Builder/Constructor.
> Changes are quite simple:
> public static <T> Builder<T> builder(OutputFile file) {
>   return new Builder<T>(file)
> }
> and in the static Builder class below
> private Builder(OutputFile file) {
>   super(file);
> }
> Note: I am not good enough with builds, maven and git to create a pull 
> request yet. Sorry. Will try to get better here.
> See: https://issues.apache.org/jira/browse/PARQUET-1142



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to