guiyanakuang commented on a change in pull request #992:
URL: https://github.com/apache/orc/pull/992#discussion_r779534940



##########
File path: java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java
##########
@@ -1134,7 +1183,10 @@ public void setRowIndexCols(boolean[] rowIndexCols) {
             if (entry == null) {
               throw new AssertionError("RG is not populated for " + columnIx + 
" rg " + rowGroup);
             }
-            OrcProto.ColumnStatistics stats = entry.getStatistics();
+            OrcProto.ColumnStatistics stats = EMPTY_COLUMN_STATISTICS;
+            if (entry.hasStatistics()) {
+              stats = entry.getStatistics();

Review comment:
       Here is the key to fix.
   
   When no column statistics are provided, entry.getStatistics() does not 
return null, but a default object that we must first determine by 
entry.hasStatistics() before getting it.
   
   `JsonFileDump` and `FileDump` has the same misuse, I'll fix them later




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