----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/26132/#review54817 -----------------------------------------------------------
A few comments below. One other thing is to see what we can do in planning phase for queries where the join column type is known e.g Hive tables. Is the cast already inserted in planning phase for such joins ? exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java <https://reviews.apache.org/r/26132/#comment95092> Is this always required ? suppose we have t1.a1 = t2.a2 AND t1.b1 = t2.a2 (i.e 2 columns from one table join to 1 column from the other table). It's possible we might error in some other place so maybe your assumption is ok for now..but worth testing and in any case we should file a bug if it fails. exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java <https://reviews.apache.org/r/26132/#comment95093> Should you check for result == null first since leastRestrictiveType() can return null. exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java <https://reviews.apache.org/r/26132/#comment95094> would be good to test with multi-column joins also with different casting.. - Aman Sinha On Sept. 29, 2014, 8:42 a.m., Mehant Baid wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/26132/ > ----------------------------------------------------------- > > (Updated Sept. 29, 2014, 8:42 a.m.) > > > Review request for drill and Aman Sinha. > > > Repository: drill-git > > > Description > ------- > > We initialize the hash table with both build and probe expressions. However > if the two expressions are of different types (eg: float and int) then the > hash value will be different even if the two values on both sides are same. > This patch fixes it so that we apply casts before performing the hash > function so that same values result in same hash values. > > > Diffs > ----- > > > exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java > 2854c14 > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java > f77407e > > exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java > 7969d49 > exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java > 388d057 > > Diff: https://reviews.apache.org/r/26132/diff/ > > > Testing > ------- > > Added unit test that has float and int on either side of the join condition. > > > Thanks, > > Mehant Baid > >
