gszadovszky commented on a change in pull request #856:
URL: https://github.com/apache/parquet-mr/pull/856#discussion_r561042620



##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
##########
@@ -1046,6 +1046,8 @@ private ColumnIndexStore getColumnIndexStore(int 
blockIndex) {
   }
 
   private RowRanges getRowRanges(int blockIndex) {
+    assert FilterCompat

Review comment:
       I think, we do not need to cover the cases of `NOOP` or `null` filters 
in every places of the API. `ColumnIndexFilter` is not really for public use. I 
do not see why a client would use it directly. I think, the current handling is 
correct: NPE is thrown in case of null and the correct filtering is done 
otherwise.
   
   What I wanted to cover here is to handle the `null` filters properly where 
the user faces it (by using setting the filter in `ParquetReadOptions`) and 
also to ensure there are no unnecessary reads (for column index or bloom 
filter) in case of `NOOP`.
   
   I think this issue is not a bug anyway. There is no correctness issue if the 
user does not set the filter explicitly to `null`.
   
   About `assert`. I think this is a good tool to ensure something that should 
happen anyway. I agree it is not suitable for checking anything in a public 
method but where the caller is properly controlled (e.g. for a private method) 
I think, it is fine. I think `assert` is fine if you could simply skip it 
without the risk of any failures. While keeping it in a private method does not 
have a performance penalty in production environment the unit tests would catch 
any issue if the callers are modified.




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