drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansinha100 <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4539: Add support for Null Equality Join...
Date Fri, 15 Apr 2016 21:08:22 GMT
Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/462#discussion_r59941224
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableConfig.java
---
    @@ -22,25 +22,36 @@
     import com.fasterxml.jackson.annotation.JsonCreator;
     import com.fasterxml.jackson.annotation.JsonProperty;
     import com.fasterxml.jackson.annotation.JsonTypeName;
    +import org.apache.drill.exec.physical.impl.join.JoinUtils.JoinComparator;
     
     @JsonTypeName("hashtable-config")
     public class HashTableConfig  {
     
    -  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HashTableConfig.class);
    -
       private final int initialCapacity;
       private final float loadFactor;
       private final NamedExpression[] keyExprsBuild;
       private final NamedExpression[] keyExprsProbe;
    +  private final JoinComparator[] comparators;
     
       @JsonCreator
       public HashTableConfig(@JsonProperty("initialCapacity") int initialCapacity, @JsonProperty("loadFactor")
float loadFactor,
                              @JsonProperty("keyExprsBuild") NamedExpression[] keyExprsBuild,
    -                         @JsonProperty("keyExprsProbe") NamedExpression[] keyExprsProbe)
{
    +                         @JsonProperty("keyExprsProbe") NamedExpression[] keyExprsProbe,
    +                         @JsonProperty("comparators") JoinComparator[] comparators) {
         this.initialCapacity = initialCapacity;
         this.loadFactor = loadFactor;
         this.keyExprsBuild = keyExprsBuild;
         this.keyExprsProbe = keyExprsProbe;
    +    if (comparators != null) {
    +      this.comparators = comparators;
    +    } else {
    +      // default is nulls are equal
    --- End diff --
    
    It might seem confusing at first (it was to me) to consider the nulls-are-equal as the
default case since that's not true for joins; however it is true for a group-by operation.
 Could you have the caller pass in explicit comparator such that the HashTableConfig does
not have to decide ?  The HashAggregate could instantiate the hash table with an IS_NOT_DISTINCT_FROM
comparator.  What do you think ?  (one minor point is that the 'JoinComparator' is now being
used for both Joins and Aggregates...we could call it Comparator or something generic). 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message