drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] vrozov commented on a change in pull request #1361: DRILL-6579: Added sanity checks to the Parquet reader to avoid infini…
Date Wed, 11 Jul 2018 23:08:43 GMT
vrozov commented on a change in pull request #1361: DRILL-6579: Added sanity checks to the
Parquet reader to avoid infini…
URL: https://github.com/apache/drill/pull/1361#discussion_r201867001
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLenBulkPageReader.java
 ##########
 @@ -106,11 +107,13 @@ final void set(PageDataInfo pageInfoInput, boolean clear) {
     pageInfo.dictionaryValueReader = pageInfoInput.dictionaryValueReader;
     pageInfo.numPageValues = pageInfoInput.numPageValues;
     if (clear) {
-    buffer.clear();
-  }
+      buffer.clear();
+    }
   }
 
   final VarLenColumnBulkEntry getEntry(int valuesToRead) {
+    Preconditions.checkArgument(valuesToRead > 0, String.format("Number of values to read
[%d] should be greater than zero", valuesToRead));
 
 Review comment:
   It may also be better to use Preconditions template instead of String template (sorry for
the wrong example in my prior comment).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message