You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Daniel Barclay <db...@maprtech.com> on 2015/02/07 00:22:48 UTC

Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/
-----------------------------------------------------------

(Updated Feb. 6, 2015, 11:22 p.m.)


Review request for drill, Jinfeng Ni and Mehant Baid.


Changes
-------

Rebased to master.


Repository: drill-git


Description
-------

Main change:  Augmented *ordering* comparison function templates
and calls to to order NULL values correctly (per "NULLS FIRST",
"NULLS LAST", or correct default (depending on whether ordering is
ascending or descending)
*  Cloned each "compare_to" function template into 
   "compare_to_nulls_high" and "compare_to_nulls_low" versions
   and adjusted to handle NULL correctly.
*  Added corresponding new version of getComparator(...).
*  Updated code around calls to getComparator(...) re NULL ordering.
*  Added test class and test data files.


Diffs (updated)
-----

  .gitignore 838ea6b 
  common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
  exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
  exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
  exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
  exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
  exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
  exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
  exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
  exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
  exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
  exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
  pom.xml 17f0e09 

Diff: https://reviews.apache.org/r/27711/diff/


Testing
-------

Ran new fix-specific unit tests. 


Thanks,

Daniel Barclay


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jacques Nadeau <ja...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review71585
-----------------------------------------------------------



exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java
<https://reviews.apache.org/r/27711/#comment117366>

    it seems like it would be much cleaner/easier if you just set the output string you want once before writing the code such as:
    
    <#if nullComparesHigh>
    nullComparisonLeft = "-1"
    nullComparisonRight = "1"
    <#else>
    nullComparisonLeft = "1"
    nullComparisonRight = "-1"
    </#if>
    
    And then you can just do ${output} = ${nullComparisonLeft} or similar in the code.  Would make the code easier to read/maintain I think.
    
    Note, I didn't actually spend any time thinking about what should be -1 and 1 in the code above, it was only to illustrate.



exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java
<https://reviews.apache.org/r/27711/#comment117368>

    I think Var comparisons should be considered MEDIUM and all others should be SIMPLE.  This is comparison to things like date parsing, which would be complex.



exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java
<https://reviews.apache.org/r/27711/#comment117369>

    If you want to put todo in this code, put inside a freemarker comment.  Otherwise, runtime compilation of this code will go slower.  
    
    In general, this whole piece of code (for all of these decimal things) should be pulled out as separate classes/static methods similar to ByteFunctionHelpers.  That should be in the todo.


- Jacques Nadeau


On Feb. 6, 2015, 11:22 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 11:22 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> Main change:  Augmented *ordering* comparison function templates
> and calls to to order NULL values correctly (per "NULLS FIRST",
> "NULLS LAST", or correct default (depending on whether ordering is
> ascending or descending)
> *  Cloned each "compare_to" function template into 
>    "compare_to_nulls_high" and "compare_to_nulls_low" versions
>    and adjusted to handle NULL correctly.
> *  Added corresponding new version of getComparator(...).
> *  Updated code around calls to getComparator(...) re NULL ordering.
> *  Added test class and test data files.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 17f0e09 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests. 
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review71600
-----------------------------------------------------------


Seems at least one unit testcase in excc/java_exec failed with different results from expected results. 

Failed tests:
TestJoinNullable.testMergeInnerJoinOnNullableColumns:60 Received unexepcted number of rows in output: expected=1, received=0 expected:<1> but was:<0>


exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java
<https://reviews.apache.org/r/27711/#comment117417>

    Is the code deleted when resolving merging conflicts? I think line 46 - 48 are needed for throwing clearer error message, when the query tries to order by , group by, or compare a complex type field.



exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java
<https://reviews.apache.org/r/27711/#comment117418>

    I think it's fine to delete this class, since the code has been moved to freemarker template.



exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java
<https://reviews.apache.org/r/27711/#comment117424>

    Can you refactor this logic into a common method? I saw several places need use this logic to get null_high.
    
    Also, it would be nice to add comment why the logical expression would cover different combination of Direction / NullDirection, including UNSPECIFIED.


- Jinfeng Ni


On Feb. 6, 2015, 3:22 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 3:22 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> Main change:  Augmented *ordering* comparison function templates
> and calls to to order NULL values correctly (per "NULLS FIRST",
> "NULLS LAST", or correct default (depending on whether ordering is
> ascending or descending)
> *  Cloned each "compare_to" function template into 
>    "compare_to_nulls_high" and "compare_to_nulls_low" versions
>    and adjusted to handle NULL correctly.
> *  Added corresponding new version of getComparator(...).
> *  Updated code around calls to getComparator(...) re NULL ordering.
> *  Added test class and test data files.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 17f0e09 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests. 
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review71537
-----------------------------------------------------------


Went through the first couple of files. Will do the rest later.


common/src/main/java/org/apache/drill/common/logical/data/Order.java
<https://reviews.apache.org/r/27711/#comment117281>

    Agree. The draft SQL standard 2003 says if null ordering is not specified, then an impleleation-defined null ordering is used.  Both Oracle and Postgresql seem to use the same policy:  NULL_LAST for ASC, and NULL_FIRST for DESC. I think Drill should adopt the same policy here.
    
    Please addd codes to set the Default null ordering based on ASC/DESC.



common/src/main/java/org/apache/drill/common/logical/data/Order.java
<https://reviews.apache.org/r/27711/#comment117282>

    Agree. The type of STRICTLY_DESCENDING and CLUSTERED seem to be defined in optiq library only. SQL standard does not have those concepts. I think we should only accept DESCENDING / ASCENDING here, and throw UnsupportedOperationException for all other cases.



exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java
<https://reviews.apache.org/r/27711/#comment117288>

    Is it true that "compare_to_nulls_high" or "compare_to_nulls_low" only needed when either side is nullable?  That is, we should not have these two functions in GCompareBigIntBigInt class ?



exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java
<https://reviews.apache.org/r/27711/#comment117289>

    Why do we keep another template for DateInterval types? Is it possible that it's erged with ComparisonFunctions.java? I saw some logic are identical.



exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java
<https://reviews.apache.org/r/27711/#comment117290>

    Can you move those TODO into a different JIRA, if you believe that's the desired result? Seems that is not related to NULL FIRST/NULL LAST issue.


- Jinfeng Ni


On Feb. 6, 2015, 3:22 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 3:22 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> Main change:  Augmented *ordering* comparison function templates
> and calls to to order NULL values correctly (per "NULLS FIRST",
> "NULLS LAST", or correct default (depending on whether ordering is
> ascending or descending)
> *  Cloned each "compare_to" function template into 
>    "compare_to_nulls_high" and "compare_to_nulls_low" versions
>    and adjusted to handle NULL correctly.
> *  Added corresponding new version of getComparator(...).
> *  Updated code around calls to getComparator(...) re NULL ordering.
> *  Added test class and test data files.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 17f0e09 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests. 
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review71802
-----------------------------------------------------------



exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
<https://reviews.apache.org/r/27711/#comment117659>

    Here, MergeJoin always uses"null_High" policy. What if the SORT operator uses null_low? Will it cause incorrect result?
    
    Can you try the following query:
    
    select X1.C1, X2.C2
    from (select C1 from T1
          ORDER BY C1 ASC NULLS FIRST) X1 JOIN
         (select C2 FROM T2
          ORDER BY C2 ASC NULLS FIRST) X2 
    ON X1.C1 = X2.C2;
    
    In the above query, SORT will use null_low for Null Direction for both sides of merge join. If merge_join uses null_high, will it return correct query result?


- Jinfeng Ni


On Feb. 6, 2015, 3:22 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 3:22 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> Main change:  Augmented *ordering* comparison function templates
> and calls to to order NULL values correctly (per "NULLS FIRST",
> "NULLS LAST", or correct default (depending on whether ordering is
> ascending or descending)
> *  Cloned each "compare_to" function template into 
>    "compare_to_nulls_high" and "compare_to_nulls_low" versions
>    and adjusted to handle NULL correctly.
> *  Added corresponding new version of getComparator(...).
> *  Updated code around calls to getComparator(...) re NULL ordering.
> *  Added test class and test data files.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 17f0e09 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests. 
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review73388
-----------------------------------------------------------

Ship it!


The new patches look good to me.

- Jinfeng Ni


On Feb. 19, 2015, 1:28 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 1:28 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> DRILL-1062:  Implemented null ordering (NULLS FIRST/NULLS LAST).
> 
> Primary:  
> - Split "compare_to" function templates (for sorting) into 
>   "compare_to_nulls_high" and "compare_to_nulls_low" versions.
> - Added tests to verify ORDER BY ordering.
> - Added tests to verify merge join order correctness.
> - Implemented java.sql.DatabaseMetaData.nullsAreSortedHigh(), etc.
> 
> Secondary:
> - Eliminated DateInterfaceFunctions.java template (merged into other).
> - Renamed comparison-related template data objects and file names.
> - Eliminated unused template macros, function template classes.
> - Overhauled Order.Ordering; added unit test.
> - Regularized some generated-class names.
> 
> Miscellaneous:
> - Added toString() to ExpressionPosition, Order.Ordering, JoinStatus.
> - Fixed some typos.
> - Fixed some comment syntax.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java 010e440 
>   common/src/main/java/org/apache/drill/common/expression/fn/CastFunctions.java f1a3b37 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java PRE-CREATION 
>   contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHiveProjectPushDown.java 0246f54 
>   exec/java-exec/src/main/codegen/config.fmpp aff6240 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/data/ComparisonTypesDecimal.tdd PRE-CREATION 
>   exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd PRE-CREATION 
>   exec/java-exec/src/main/codegen/data/DateTypes.tdd 5802df0 
>   exec/java-exec/src/main/codegen/data/DecimalTypes.tdd 423fe89 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java 1ed3cb3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java e1ad854 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java 25dcbbc 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java 3fe489f 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java ea19645 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java a7fa5aa 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java 48a0996 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/MSorter.java e80d309 
>   exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ProjectPrule.java 6d26419 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/java-exec/src/test/java/org/apache/drill/TestAggNullable.java 4c9617b 
>   exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java 9d3b8dc 
>   exec/java-exec/src/test/java/org/apache/drill/TestInList.java 03fbf97 
>   exec/java-exec/src/test/java/org/apache/drill/TestJoinNullable.java c49da6c 
>   exec/java-exec/src/test/resources/jsoninput/nullableOrdered1.json PRE-CREATION 
>   exec/java-exec/src/test/resources/jsoninput/nullableOrdered2.json PRE-CREATION 
>   exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillDatabaseMetaData.java PRE-CREATION 
>   exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillFactory.java 9b9eb7b 
>   exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillJdbc41Factory.java 7fb0a34 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 7f973c8 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests, existing tests.
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Daniel Barclay <db...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/
-----------------------------------------------------------

(Updated Feb. 19, 2015, 9:28 p.m.)


Review request for drill, Jinfeng Ni and Mehant Baid.


Repository: drill-git


Description
-------

DRILL-1062:  Implemented null ordering (NULLS FIRST/NULLS LAST).

Primary:  
- Split "compare_to" function templates (for sorting) into 
  "compare_to_nulls_high" and "compare_to_nulls_low" versions.
- Added tests to verify ORDER BY ordering.
- Added tests to verify merge join order correctness.
- Implemented java.sql.DatabaseMetaData.nullsAreSortedHigh(), etc.

Secondary:
- Eliminated DateInterfaceFunctions.java template (merged into other).
- Renamed comparison-related template data objects and file names.
- Eliminated unused template macros, function template classes.
- Overhauled Order.Ordering; added unit test.
- Regularized some generated-class names.

Miscellaneous:
- Added toString() to ExpressionPosition, Order.Ordering, JoinStatus.
- Fixed some typos.
- Fixed some comment syntax.


Diffs
-----

  .gitignore 838ea6b 
  common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java 010e440 
  common/src/main/java/org/apache/drill/common/expression/fn/CastFunctions.java f1a3b37 
  common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
  common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java PRE-CREATION 
  contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHiveProjectPushDown.java 0246f54 
  exec/java-exec/src/main/codegen/config.fmpp aff6240 
  exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
  exec/java-exec/src/main/codegen/data/ComparisonTypesDecimal.tdd PRE-CREATION 
  exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd PRE-CREATION 
  exec/java-exec/src/main/codegen/data/DateTypes.tdd 5802df0 
  exec/java-exec/src/main/codegen/data/DecimalTypes.tdd 423fe89 
  exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
  exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
  exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
  exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
  exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java 1ed3cb3 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java e1ad854 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java 25dcbbc 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java 3fe489f 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java ea19645 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java a7fa5aa 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java 48a0996 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/MSorter.java e80d309 
  exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ProjectPrule.java 6d26419 
  exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
  exec/java-exec/src/test/java/org/apache/drill/TestAggNullable.java 4c9617b 
  exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java 9d3b8dc 
  exec/java-exec/src/test/java/org/apache/drill/TestInList.java 03fbf97 
  exec/java-exec/src/test/java/org/apache/drill/TestJoinNullable.java c49da6c 
  exec/java-exec/src/test/resources/jsoninput/nullableOrdered1.json PRE-CREATION 
  exec/java-exec/src/test/resources/jsoninput/nullableOrdered2.json PRE-CREATION 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillDatabaseMetaData.java PRE-CREATION 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillFactory.java 9b9eb7b 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillJdbc41Factory.java 7fb0a34 
  exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
  exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
  exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
  pom.xml 7f973c8 

Diff: https://reviews.apache.org/r/27711/diff/


Testing (updated)
-------

Ran new fix-specific unit tests, existing tests.


Thanks,

Daniel Barclay


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Daniel Barclay <db...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/
-----------------------------------------------------------

(Updated Feb. 18, 2015, 4:54 a.m.)


Review request for drill, Jinfeng Ni and Mehant Baid.


Repository: drill-git


Description (updated)
-------

DRILL-1062:  Implemented null ordering (NULLS FIRST/NULLS LAST).

Primary:  
- Split "compare_to" function templates (for sorting) into 
  "compare_to_nulls_high" and "compare_to_nulls_low" versions.
- Added tests to verify ORDER BY ordering.
- Added tests to verify merge join order correctness.
- Implemented java.sql.DatabaseMetaData.nullsAreSortedHigh(), etc.

Secondary:
- Eliminated DateInterfaceFunctions.java template (merged into other).
- Renamed comparison-related template data objects and file names.
- Eliminated unused template macros, function template classes.
- Overhauled Order.Ordering; added unit test.
- Regularized some generated-class names.

Miscellaneous:
- Added toString() to ExpressionPosition, Order.Ordering, JoinStatus.
- Fixed some typos.
- Fixed some comment syntax.


Diffs (updated)
-----

  .gitignore 838ea6b 
  common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java 010e440 
  common/src/main/java/org/apache/drill/common/expression/fn/CastFunctions.java f1a3b37 
  common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
  common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java PRE-CREATION 
  contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHiveProjectPushDown.java 0246f54 
  exec/java-exec/src/main/codegen/config.fmpp aff6240 
  exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
  exec/java-exec/src/main/codegen/data/ComparisonTypesDecimal.tdd PRE-CREATION 
  exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd PRE-CREATION 
  exec/java-exec/src/main/codegen/data/DateTypes.tdd 5802df0 
  exec/java-exec/src/main/codegen/data/DecimalTypes.tdd 423fe89 
  exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
  exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
  exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
  exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
  exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java 1ed3cb3 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java e1ad854 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java 25dcbbc 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java 3fe489f 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
  exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/ChainedHashTable.java ea19645 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java a7fa5aa 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java 48a0996 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
  exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/MSorter.java e80d309 
  exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ProjectPrule.java 6d26419 
  exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
  exec/java-exec/src/test/java/org/apache/drill/TestAggNullable.java 4c9617b 
  exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java 9d3b8dc 
  exec/java-exec/src/test/java/org/apache/drill/TestInList.java 03fbf97 
  exec/java-exec/src/test/java/org/apache/drill/TestJoinNullable.java c49da6c 
  exec/java-exec/src/test/resources/jsoninput/nullableOrdered1.json PRE-CREATION 
  exec/java-exec/src/test/resources/jsoninput/nullableOrdered2.json PRE-CREATION 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillDatabaseMetaData.java PRE-CREATION 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillFactory.java 9b9eb7b 
  exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillJdbc41Factory.java 7fb0a34 
  exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
  exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
  exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
  pom.xml 7f973c8 

Diff: https://reviews.apache.org/r/27711/diff/


Testing (updated)
-------

Ran new change-specific tests, existing tests.


Thanks,

Daniel Barclay


Re: Review Request 27711: To fix DRILL-1062, honoring "NULLS FIRST" and "NULLS LAST"

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27711/#review71571
-----------------------------------------------------------



exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java
<https://reviews.apache.org/r/27711/#comment117332>

    It would be nice if we add nulls = NullHandling.INTERNAL to those two function templates.



exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java
<https://reviews.apache.org/r/27711/#comment117331>

    For operators like <, <=, ==, since they uses NULL_IF_NULL policy, the nulCompareHigh=false seems would not impact the comparision result, when any side of the operators is NULL. It would be nice to add a comment saying NULL_IF_NULL will override the set of nullCompareHigh=false in those operators.



exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java
<https://reviews.apache.org/r/27711/#comment117333>

    Do we really need line 25 - 30?


- Jinfeng Ni


On Feb. 6, 2015, 3:22 p.m., Daniel Barclay wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27711/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 3:22 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Mehant Baid.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> Main change:  Augmented *ordering* comparison function templates
> and calls to to order NULL values correctly (per "NULLS FIRST",
> "NULLS LAST", or correct default (depending on whether ordering is
> ascending or descending)
> *  Cloned each "compare_to" function template into 
>    "compare_to_nulls_high" and "compare_to_nulls_low" versions
>    and adjusted to handle NULL correctly.
> *  Added corresponding new version of getComparator(...).
> *  Updated code around calls to getComparator(...) re NULL ordering.
> *  Added test class and test data files.
> 
> 
> Diffs
> -----
> 
>   .gitignore 838ea6b 
>   common/src/main/java/org/apache/drill/common/logical/data/Order.java dada606 
>   exec/java-exec/src/main/codegen/data/CompareTypes.tdd f384d52 
>   exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java 628277c 
>   exec/java-exec/src/main/codegen/templates/DateIntervalFunctions.java 8fe13bb 
>   exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java 960368a 
>   exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java 0c4af01 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java 1f732a3 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java d007d7c 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctions.java bf42ce6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ComparisonFunctionsNullable.java 570aaeb 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java 9829fc6 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java 860627d 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java 257b93e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java d78ba8e 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java a062074 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java 19f5423 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/StreamingWindowFrameRecordBatch.java 26d23f2 
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java 9026661 
>   exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/QueryResultHandler.java 9015a16 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcNullOrderingAndGroupingTest.java PRE-CREATION 
>   exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b627c38 
>   exec/jdbc/src/test/resources/donuts.json PRE-CREATION 
>   exec/jdbc/src/test/resources/null_ordering_and_grouping_data.json PRE-CREATION 
>   pom.xml 17f0e09 
> 
> Diff: https://reviews.apache.org/r/27711/diff/
> 
> 
> Testing
> -------
> 
> Ran new fix-specific unit tests. 
> 
> 
> Thanks,
> 
> Daniel Barclay
> 
>