You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2020/08/31 22:31:45 UTC

[GitHub] [orc] omalley commented on a change in pull request #542: ORC-623 Fix evaluation of SArgs over all null columns for ints and doubles.

omalley commented on a change in pull request #542:
URL: https://github.com/apache/orc/pull/542#discussion_r480436966



##########
File path: java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java
##########
@@ -403,16 +406,18 @@ public void testGetMin() throws Exception {
 
   private static OrcProto.ColumnStatistics createIntStats(Long min,
                                                           Long max) {
+    OrcProto.ColumnStatistics.Builder result =
+        OrcProto.ColumnStatistics.newBuilder();
     OrcProto.IntegerStatistics.Builder intStats =
         OrcProto.IntegerStatistics.newBuilder();
     if (min != null) {
       intStats.setMinimum(min);
+      result.setNumberOfValues(1);

Review comment:
       Ok, the fix was about handling ColumnStatistics when there were no non-null values. So the added branch checks the number of values in the statistics. In real files, the only way to have a minimum or maximum is to have had at least one value, so it works.
   
   In the sarg tests though, we were creating artificial ColumnStatistics that had minimum and maximum without any values. They broke with the new code. The fix was to make the artificial ColumnStatistics have a non-zero number of values.




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