initialize min and max functions for bit

Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/3efba1e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/3efba1e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/3efba1e2

Branch: refs/heads/master
Commit: 3efba1e281b6e47a9b1f3ad47882ffadc97b4335
Parents: 9d233cb
Author: Steven Phillips <[email protected]>
Authored: Wed Apr 2 16:28:42 2014 -0700
Committer: Jacques Nadeau <[email protected]>
Committed: Sat Apr 19 18:07:11 2014 -0700

----------------------------------------------------------------------
 .../src/main/codegen/templates/AggrTypeFunctions1.java       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3efba1e2/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java 
b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java
index 9abc768..14ca1ce 100644
--- a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java
+++ b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java
@@ -61,7 +61,9 @@ public static class ${type.inputType}${aggrtype.className} 
implements DrillAggFu
        <#if aggrtype.funcName == "sum" || aggrtype.funcName == "count">
          value.value = 0;
        <#elseif aggrtype.funcName == "min">
-         <#if type.runningType?starts_with("Int")>
+    <#if type.runningType?starts_with("Bit")>
+        value.value = 1;
+         <#elseif type.runningType?starts_with("Int")>
            value.value = Integer.MAX_VALUE;
          <#elseif type.runningType?starts_with("BigInt")>
            value.value = Long.MAX_VALUE;
@@ -71,7 +73,9 @@ public static class ${type.inputType}${aggrtype.className} 
implements DrillAggFu
                value.value = Double.MAX_VALUE;     
          </#if>
        <#elseif aggrtype.funcName == "max">
-         <#if type.runningType?starts_with("Int")>
+    <#if type.runningType?starts_with("Bit")>
+        value.value = 0;
+         <#elseif type.runningType?starts_with("Int")>
            value.value = Integer.MIN_VALUE;
          <#elseif type.runningType?starts_with("BigInt")>
            value.value = Long.MIN_VALUE;

Reply via email to