anantdamle commented on a change in pull request #13619:
URL: https://github.com/apache/beam/pull/13619#discussion_r549561660



##########
File path: 
sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java
##########
@@ -835,13 +906,18 @@ public void processElement(ProcessContext processContext) 
throws Exception {
 
         SeekableByteChannel seekableByteChannel = file.openSeekable();
 
-        AvroParquetReader.Builder builder =
-            AvroParquetReader.<GenericRecord>builder(new 
BeamParquetInputFile(seekableByteChannel));
+        AvroParquetReader.Builder<GenericRecord> builder =
+            AvroParquetReader.builder(new 
BeamParquetInputFile(seekableByteChannel));
         if (modelClass != null) {
           // all GenericData implementations have a static get method
           builder = builder.withDataModel((GenericData) 
modelClass.getMethod("get").invoke(null));
         }
 
+        if (hadoopBaseConfig != null) {

Review comment:
       looking at the 
[`SerializableConfiguration#91`](https://github.com/apache/beam/blob/3bb232fb098700de408f574585dfe74bbaff7230/sdks/java/io/hadoop-common/src/main/java/org/apache/beam/sdk/io/hadoop/SerializableConfiguration.java#L91)
 , It seems `null` is the expected value for building a default configuration. 
   
   I've also replaced all `configuration != null` checks with 
`SerializableConfiguration.newConfiguration(configuration)` for consistency and 
to avoid `NPE`. What do you think?
   




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to