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

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

rdblue closed pull request #464: PARQUET-1263: If file has a config, use it for 
ParquetReadOptions.
URL: https://github.com/apache/parquet-mr/pull/464
 
 
   

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-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java 
b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java
index 1ba5380c8..22c219885 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 void close() throws IOException {
     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 @@ protected Builder(Path path) {
       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


 

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


> ParquetReader's builder should use Configuration from the InputFile
> -------------------------------------------------------------------
>
>                 Key: PARQUET-1263
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1263
>             Project: Parquet
>          Issue Type: Improvement
>            Reporter: Ryan Blue
>            Priority: Major
>             Fix For: 1.10.0
>
>
> ParquetReader can be built using an InputFile, which may be a HadoopInputFile 
> and have a Configuration. If it is, ParquetHadoopOptions should be be based 
> on that configuration instance.



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

Reply via email to