ggershinsky commented on a change in pull request #925:
URL: https://github.com/apache/parquet-mr/pull/925#discussion_r700210573



##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
##########
@@ -1254,14 +1276,41 @@ static FileMetaData 
filterFileMetaDataByMidpoint(FileMetaData metaData, RangeMet
     return metaData;
   }
 
+  private static long tryUseFileOffset(RowGroup rowGroup, long preStartIndex, 
long preCompressedSize) {
+    long startIndex = 0;
+    startIndex = rowGroup.getFile_offset();
+    // skip checking the first rowGroup
+    // (in case of summary file, there are multiple first groups from 
different footers)
+    if (preStartIndex != 0 && preStartIndex <= startIndex) {
+
+      //calculate start index for other blocks
+      long minStartIndex = preStartIndex + preCompressedSize;
+      if (startIndex < minStartIndex) {
+        // a bad offset detected, try first column's offset
+        // can not use minStartIndex in case of padding
+        startIndex = getOffset(rowGroup.getColumns().get(0));

Review comment:
       that might work for range filtering. as for the explicit offset 
filtering, the precision might be important. In systems that [use 
padding](https://github.com/apache/parquet-mr/blob/master/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopOutputFile.java#L37)
 (HDFS, WEBHDFS, VIEWFS)  - instead of `startIndex = minStartIndex` , we might 
have to throw an exception when this is called from  
`filterFileMetaDataByStart` saying that this file can't be split by offsets, 
and should be processed without splitting. Again, given the number of 
conditions for this situation to occur, and the fact that 1.12.0 is not 
released yet any framework, such exceptions might never be thrown in reality.




-- 
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: [email protected]

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


Reply via email to