Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/805#discussion_r126438246
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java 
---
    @@ -1008,8 +1008,24 @@ public void setMax(Object max) {
           return nulls;
         }
     
    -    @Override public boolean hasSingleValue() {
    -      return (max != null && min != null && max.equals(min));
    +    /**
    +     * Checks that the column chunk has single value.
    +     * Returns true if min and max are the same, but not null.
    +     * Returns true if min and max are null and the number of null values
    +     * in the column chunk is greater than 0.
    +     *
    +     * @return true if column has single value
    --- End diff --
    
    Thanks for such detailed analysis. This bug is also reproduced on master 
version, but it appears due to the wrong result of this method. Added a 
comparison of `nulls` with rows count to fix this bug and allow to return true 
for the case when field has only nulls.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to