You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@parquet.apache.org by "joyCurry30 (via GitHub)" <gi...@apache.org> on 2024/07/11 01:19:16 UTC
[PR] PARQUET-2948: Fix the npe when using the AvroParquetReader.Builder with a LocalInputFile. [parquet-java]
joyCurry30 opened a new pull request, #2949:
URL: https://github.com/apache/parquet-java/pull/2949
<!--
Thanks for opening a pull request!
If you're new to Parquet-Java, information on how to contribute can be found here: https://parquet.apache.org/docs/contribution-guidelines/contributing
Please open a GitHub issue for this pull request: https://github.com/apache/parquet-java/issues/new/choose
and format pull request title as below:
GH-${GITHUB_ISSUE_ID}: ${SUMMARY}
or simply use the title below if it is a minor issue:
MINOR: ${SUMMARY}
-->
### Rationale for this change
Refer to : https://github.com/apache/parquet-java/issues/2948
### What changes are included in this PR?
Fix the npe when using the AvroParquetReader.Builder with a LocalInputFile.
### Are these changes tested?
Yes
### Are there any user-facing changes?
<!-- Please uncomment the line below and replace ${GITHUB_ISSUE_ID} with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] GH-2948: Fix NPE when using the AvroParquetReader.Builder with LocalInputFile [parquet-java]
Posted by "joyCurry30 (via GitHub)" <gi...@apache.org>.
joyCurry30 commented on code in PR #2949:
URL: https://github.com/apache/parquet-java/pull/2949#discussion_r1673851150
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java:
##########
@@ -230,11 +230,12 @@ protected Builder(InputFile file) {
if (file instanceof HadoopInputFile) {
HadoopInputFile hadoopFile = (HadoopInputFile) file;
this.conf = hadoopFile.getConfiguration();
- this.configuration = new HadoopParquetConfiguration(this.conf);
optionsBuilder = HadoopReadOptions.builder(this.conf, hadoopFile.getPath());
} else {
+ this.conf = new Configuration();
optionsBuilder = ParquetReadOptions.builder(new HadoopParquetConfiguration());
Review Comment:
I think it's better than mine.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] GH-2948: Fix NPE when using the AvroParquetReader.Builder with LocalInputFile [parquet-java]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac merged PR #2949:
URL: https://github.com/apache/parquet-java/pull/2949
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] GH-2948: Fix NPE when using the AvroParquetReader.Builder with LocalInputFile [parquet-java]
Posted by "joyCurry30 (via GitHub)" <gi...@apache.org>.
joyCurry30 commented on code in PR #2949:
URL: https://github.com/apache/parquet-java/pull/2949#discussion_r1676044512
##########
parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestParquetReader.java:
##########
@@ -54,8 +54,8 @@
@RunWith(Parameterized.class)
public class TestParquetReader {
- private static final Path FILE_V1 = createTempFile();
- private static final Path FILE_V2 = createTempFile();
+ public static final Path FILE_V1 = createTempFile();
Review Comment:
Ok, I will do it.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] GH-2948: Fix NPE when using the AvroParquetReader.Builder with LocalInputFile [parquet-java]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on code in PR #2949:
URL: https://github.com/apache/parquet-java/pull/2949#discussion_r1676008437
##########
parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestParquetReader.java:
##########
@@ -54,8 +54,8 @@
@RunWith(Parameterized.class)
public class TestParquetReader {
- private static final Path FILE_V1 = createTempFile();
- private static final Path FILE_V2 = createTempFile();
+ public static final Path FILE_V1 = createTempFile();
Review Comment:
Could you please revert these lines?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] GH-2948: Fix NPE when using the AvroParquetReader.Builder with LocalInputFile [parquet-java]
Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on code in PR #2949:
URL: https://github.com/apache/parquet-java/pull/2949#discussion_r1673743968
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java:
##########
@@ -230,11 +230,12 @@ protected Builder(InputFile file) {
if (file instanceof HadoopInputFile) {
HadoopInputFile hadoopFile = (HadoopInputFile) file;
this.conf = hadoopFile.getConfiguration();
- this.configuration = new HadoopParquetConfiguration(this.conf);
optionsBuilder = HadoopReadOptions.builder(this.conf, hadoopFile.getPath());
} else {
+ this.conf = new Configuration();
optionsBuilder = ParquetReadOptions.builder(new HadoopParquetConfiguration());
Review Comment:
The idea behind `HadoopParquetConfiguration` is to run without Hadoop. With this line we initialize a Hadoop configuration while it is not a Hadoop file.
What do you think of:
```suggestion
this.configuration = new HadoopParquetConfiguration();
optionsBuilder = ParquetReadOptions.builder(this.configuration);
```
--
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.
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org