parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [parquet-mr] branch master updated: PARQUET-1183: Add Avro builders using InputFile and OutputFile. (#460)
Date Fri, 30 Mar 2018 22:24:19 GMT
This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new d54fad8  PARQUET-1183: Add Avro builders using InputFile and OutputFile. (#460)
d54fad8 is described below

commit d54fad867da7f762ac4c0d947adffdc1f8f356f1
Author: Ryan Blue <rdblue@users.noreply.github.com>
AuthorDate: Fri Mar 30 15:24:17 2018 -0700

    PARQUET-1183: Add Avro builders using InputFile and OutputFile. (#460)
    
    * PARQUET-1183: Add Avro builders using InputFile and OutputFile.
    * PARQUET-1183: Add deprecation warnings to Avro read builder.
    
    Closes #446
---
 .../java/org/apache/parquet/avro/AvroParquetReader.java    | 14 ++++++++++++++
 .../java/org/apache/parquet/avro/AvroParquetWriter.java    |  9 +++++++++
 2 files changed, 23 insertions(+)

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 a361c62..442c5b7 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.hadoop.fs.Path;
 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 class AvroParquetReader<T> extends ParquetReader<T>
{
     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 d0c0633..3e802a8 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.column.ParquetProperties.WriterVersion;
 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 @@ public class AvroParquetWriter<T> extends ParquetWriter<T>
{
     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 @@ public class AvroParquetWriter<T> extends ParquetWriter<T>
{
       super(file);
     }
 
+    private Builder(OutputFile file) {
+      super(file);
+    }
+
     public Builder<T> withSchema(Schema schema) {
       this.schema = schema;
       return this;

-- 
To stop receiving notification emails like this one, please contact
blue@apache.org.

Mime
View raw message