You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by bl...@apache.org on 2018/03/30 22:31:04 UTC

[parquet-mr] branch master updated: PARQUET-1263: If file has a config, use it for ParquetReadOptions. (#464)

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 12bbaf3  PARQUET-1263: If file has a config, use it for ParquetReadOptions. (#464)
12bbaf3 is described below

commit 12bbaf3550d56bc945b50f538b5f18af93bd316a
Author: Ryan Blue <rd...@users.noreply.github.com>
AuthorDate: Fri Mar 30 15:31:01 2018 -0700

    PARQUET-1263: If file has a config, use it for ParquetReadOptions. (#464)
---
 .../main/java/org/apache/parquet/hadoop/ParquetReader.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java
index 1ba5380..22c2198 100644
--- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java
+++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java
@@ -177,14 +177,16 @@ public class ParquetReader<T> implements Closeable {
     private final InputFile file;
     private final Path path;
     private Filter filter = null;
-    protected Configuration conf = new Configuration();
-    private ParquetReadOptions.Builder optionsBuilder = HadoopReadOptions.builder(conf);
+    protected Configuration conf;
+    private ParquetReadOptions.Builder optionsBuilder;
 
     @Deprecated
     private Builder(ReadSupport<T> readSupport, Path path) {
       this.readSupport = checkNotNull(readSupport, "readSupport");
       this.file = null;
       this.path = checkNotNull(path, "path");
+      this.conf = new Configuration();
+      this.optionsBuilder = HadoopReadOptions.builder(conf);
     }
 
     @Deprecated
@@ -192,12 +194,20 @@ public class ParquetReader<T> implements Closeable {
       this.readSupport = null;
       this.file = null;
       this.path = checkNotNull(path, "path");
+      this.conf = new Configuration();
+      this.optionsBuilder = HadoopReadOptions.builder(conf);
     }
 
     protected Builder(InputFile file) {
       this.readSupport = null;
       this.file = checkNotNull(file, "file");
       this.path = null;
+      if (file instanceof HadoopInputFile) {
+        this.conf = ((HadoopInputFile) file).getConfiguration();
+      } else {
+        this.conf = new Configuration();
+      }
+      optionsBuilder = HadoopReadOptions.builder(conf);
     }
 
     // when called, resets options to the defaults from conf

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