bit agg functions
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/8e2b9505 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/8e2b9505 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/8e2b9505 Branch: refs/heads/master Commit: 8e2b95057d9e46cc7cfed699eb93c47c386f2e6b Parents: d91a01a Author: Steven Phillips <[email protected]> Authored: Wed Apr 2 15:01:29 2014 -0700 Committer: Jacques Nadeau <[email protected]> Committed: Sat Apr 19 18:07:10 2014 -0700 ---------------------------------------------------------------------- exec/java-exec/src/main/codegen/data/AggrTypes1.tdd | 13 ++++++++++++- .../java/org/apache/drill/exec/vector/BitVector.java | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/8e2b9505/exec/java-exec/src/main/codegen/data/AggrTypes1.tdd ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/data/AggrTypes1.tdd b/exec/java-exec/src/main/codegen/data/AggrTypes1.tdd index ac5d6eb..e0a1c11 100644 --- a/exec/java-exec/src/main/codegen/data/AggrTypes1.tdd +++ b/exec/java-exec/src/main/codegen/data/AggrTypes1.tdd @@ -17,10 +17,12 @@ { aggrtypes: [ {className: "Min", funcName: "min", types: [ + {inputType: "Bit", outputType: "Bit", runningType: "Bit"}, {inputType: "Int", outputType: "Int", runningType: "Int"}, {inputType: "BigInt", outputType: "BigInt", runningType: "BigInt"}, + {inputType: "NullableBit", outputType: "Bit", runningType: "Bit"}, {inputType: "NullableInt", outputType: "Int", runningType: "Int"}, - {inputType: "NullableBigInt", outputType: "BigInt", runningType: "BigInt"}, + {inputType: "NullableBigInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "Float4", outputType: "Float4", runningType: "Float4"}, {inputType: "Float8", outputType: "Float8", runningType: "Float8"}, {inputType: "NullableFloat4", outputType: "Float4", runningType: "Float4"}, @@ -28,8 +30,11 @@ ] }, {className: "Max", funcName: "max", types: [ + {inputType: "Bit", outputType: "Bit", runningType: "Bit"}, {inputType: "Int", outputType: "Int", runningType: "Int"}, {inputType: "BigInt", outputType: "BigInt", runningType: "BigInt"}, + {inputType: "NullableBit", outputType: "Bit", runningType: "Bit"}, + {inputType: "NullableInt", outputType: "Int", runningType: "Int"}, {inputType: "NullableInt", outputType: "Int", runningType: "Int"}, {inputType: "NullableBigInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "Float4", outputType: "Float4", runningType: "Float4"}, @@ -39,8 +44,11 @@ ] }, {className: "Sum", funcName: "sum", types: [ + {inputType: "Bit", outputType: "Bit", runningType: "Bit"}, {inputType: "Int", outputType: "BigInt", runningType: "BigInt"}, {inputType: "BigInt", outputType: "BigInt", runningType: "BigInt"}, + {inputType: "NullableBit", outputType: "Bit", runningType: "Bit"}, + {inputType: "NullableInt", outputType: "Int", runningType: "Int"}, {inputType: "NullableInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "NullableBigInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "Float4", outputType: "Float8", runningType: "Float8"}, @@ -50,8 +58,11 @@ ] }, {className: "Count", funcName: "count", types: [ + {inputType: "Bit", outputType: "Bit", runningType: "Bit"}, {inputType: "Int", outputType: "BigInt", runningType: "BigInt"}, {inputType: "BigInt", outputType: "BigInt", runningType: "BigInt"}, + {inputType: "NullableBit", outputType: "Bit", runningType: "Bit"}, + {inputType: "NullableInt", outputType: "Int", runningType: "Int"}, {inputType: "NullableInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "NullableBigInt", outputType: "BigInt", runningType: "BigInt"}, {inputType: "Float4", outputType: "BigInt", runningType: "BigInt"}, http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/8e2b9505/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java index 1b4c3da..619fdad 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java @@ -242,6 +242,18 @@ public final class BitVector extends BaseDataValueVector implements FixedWidthVe return true; } + public boolean setSafe(int index, BitHolder holder) { + if(index >= getValueCapacity()) return false; + set(index, holder.value); + return true; + } + + public boolean setSafe(int index, NullableBitHolder holder) { + if(index >= getValueCapacity()) return false; + set(index, holder.value); + return true; + } + public final void setValueCount(int valueCount) { BitVector.this.valueCount = valueCount; data.writerIndex(getSizeFromCount(valueCount));
