DRILL-2143: Part 1 - just remove RecordBatch from UDF setup method. Disable date/time functions as they can no longer access incoming recordbatch to get query start time or timezone. During rebase DateTypeFunctions.CurrentDate was updated to include a commented out vesion of the fix from DRILL-2372, this will be fixed in the new patch for part 2 of 2143.
Remove RecordBatch from setup of a new new UDFs. Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/bff7b9ef Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/bff7b9ef Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/bff7b9ef Branch: refs/heads/master Commit: bff7b9ef5a9f345908aca160a97b98f6ab187708 Parents: ae2053d Author: Jason Altekruse <[email protected]> Authored: Fri Feb 6 10:43:38 2015 -0800 Committer: Jason Altekruse <[email protected]> Committed: Tue Mar 17 12:20:53 2015 -0700 ---------------------------------------------------------------------- .../AggrBitwiseLogicalTypeFunctions.java | 3 +- .../codegen/templates/AggrTypeFunctions1.java | 3 +- .../codegen/templates/AggrTypeFunctions2.java | 3 +- .../codegen/templates/AggrTypeFunctions3.java | 3 +- .../main/codegen/templates/CastDateDate.java | 2 +- .../main/codegen/templates/CastDateVarChar.java | 2 +- .../main/codegen/templates/CastFunctions.java | 2 +- .../templates/CastFunctionsSrcVarLen.java | 2 +- .../CastFunctionsSrcVarLenTargetVarLen.java | 2 +- .../templates/CastFunctionsTargetVarLen.java | 2 +- .../src/main/codegen/templates/CastHigh.java | 2 +- .../codegen/templates/CastIntervalInterval.java | 4 +- .../codegen/templates/CastIntervalVarChar.java | 6 +- .../main/codegen/templates/CastVarCharDate.java | 2 +- .../codegen/templates/CastVarCharInterval.java | 2 +- .../templates/CastVarCharToNullableNumeric.java | 2 +- .../codegen/templates/ComparisonFunctions.java | 16 +-- .../templates/ConvertToNullableHolder.java | 2 +- .../templates/CorrelationTypeFunctions.java | 2 +- .../codegen/templates/CovarTypeFunctions.java | 2 +- .../templates/DateIntervalAggrFunctions1.java | 3 +- .../DateDateArithmeticFunctions.java | 2 +- .../DateIntervalArithmeticFunctions.java | 12 +-- .../DateToCharFunctions.java | 2 +- .../DateTruncFunctions.java | 2 +- .../DateIntervalFunctionTemplates/Extract.java | 4 +- .../IntervalIntervalArithmetic.java | 6 +- .../IntervalNumericArithmetic.java | 6 +- .../ToDateTypeFunctions.java | 2 +- .../ToTimeStampFunction.java | 2 +- .../Decimal/CastDecimalDenseDecimalSparse.java | 2 +- .../templates/Decimal/CastDecimalFloat.java | 4 +- .../templates/Decimal/CastDecimalInt.java | 4 +- .../templates/Decimal/CastDecimalSimilar.java | 2 +- .../Decimal/CastDecimalSparseDecimalDense.java | 2 +- .../templates/Decimal/CastDecimalVarchar.java | 4 +- .../templates/Decimal/CastDownwardDecimal.java | 6 +- .../templates/Decimal/CastFloatDecimal.java | 2 +- .../templates/Decimal/CastIntDecimal.java | 2 +- .../templates/Decimal/CastSrcDecimalSimple.java | 6 +- .../templates/Decimal/CastVarCharDecimal.java | 4 +- .../Decimal/DecimalAggrTypeFunctions1.java | 2 +- .../Decimal/DecimalAggrTypeFunctions2.java | 2 +- .../templates/Decimal/DecimalFunctions.java | 100 +++++++++--------- .../templates/IntervalAggrFunctions2.java | 3 +- .../templates/MathFunctionTemplates.java | 2 +- .../main/codegen/templates/MathFunctions.java | 12 +-- .../main/codegen/templates/NullOperator.java | 4 +- .../templates/NumericFunctionsTemplates.java | 2 +- .../templates/NumericToCharFunctions.java | 2 +- .../src/main/codegen/templates/SumZeroAggr.java | 3 +- .../templates/VarCharAggrFunctions1.java | 2 +- .../apache/drill/exec/expr/DrillAggFunc.java | 10 +- .../apache/drill/exec/expr/DrillSimpleFunc.java | 2 +- .../expr/fn/impl/AggregateErrorFunctions.java | 5 +- .../drill/exec/expr/fn/impl/Alternator.java | 5 +- .../drill/exec/expr/fn/impl/BitFunctions.java | 7 +- .../exec/expr/fn/impl/BooleanAggrFunctions.java | 9 +- .../drill/exec/expr/fn/impl/ByteSubstring.java | 3 +- .../drill/exec/expr/fn/impl/CastBigIntDate.java | 3 +- .../exec/expr/fn/impl/CastBigIntTimeStamp.java | 3 +- .../expr/fn/impl/CastBigIntTimeStampTZ.java | 3 +- .../drill/exec/expr/fn/impl/CastIntTime.java | 3 +- .../exec/expr/fn/impl/CastVarCharVar16Char.java | 3 +- .../drill/exec/expr/fn/impl/CharSubstring.java | 3 +- .../exec/expr/fn/impl/DateTypeFunctions.java | 105 +++++++++---------- .../drill/exec/expr/fn/impl/HashFunctions.java | 65 ++++++------ .../apache/drill/exec/expr/fn/impl/IsFalse.java | 5 +- .../drill/exec/expr/fn/impl/IsNotFalse.java | 5 +- .../drill/exec/expr/fn/impl/IsNotTrue.java | 5 +- .../apache/drill/exec/expr/fn/impl/IsTrue.java | 5 +- .../apache/drill/exec/expr/fn/impl/Mappify.java | 3 +- .../drill/exec/expr/fn/impl/MathFunctions.java | 11 +- .../org/apache/drill/exec/expr/fn/impl/Not.java | 5 +- .../exec/expr/fn/impl/SimpleCastFunctions.java | 5 +- .../expr/fn/impl/SimpleRepeatedFunctions.java | 35 +++---- .../exec/expr/fn/impl/StringFunctions.java | 71 +++++++------ .../expr/fn/impl/conv/BigIntBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/BigIntBEConvertTo.java | 3 +- .../expr/fn/impl/conv/BigIntConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/BigIntConvertTo.java | 3 +- .../fn/impl/conv/BigIntVLongConvertFrom.java | 3 +- .../expr/fn/impl/conv/BigIntVLongConvertTo.java | 3 +- .../fn/impl/conv/BooleanByteConvertFrom.java | 3 +- .../expr/fn/impl/conv/BooleanByteConvertTo.java | 3 +- .../fn/impl/conv/DateEpochBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/DateEpochBEConvertTo.java | 3 +- .../expr/fn/impl/conv/DateEpochConvertFrom.java | 3 +- .../expr/fn/impl/conv/DateEpochConvertTo.java | 3 +- .../expr/fn/impl/conv/DoubleBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/DoubleBEConvertTo.java | 3 +- .../expr/fn/impl/conv/DoubleConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/DoubleConvertTo.java | 3 +- .../expr/fn/impl/conv/DummyConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/DummyConvertTo.java | 3 +- .../exec/expr/fn/impl/conv/DummyFlatten.java | 4 +- .../expr/fn/impl/conv/FloatBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/FloatBEConvertTo.java | 3 +- .../expr/fn/impl/conv/FloatConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/FloatConvertTo.java | 3 +- .../expr/fn/impl/conv/IntBEConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/IntBEConvertTo.java | 3 +- .../exec/expr/fn/impl/conv/IntConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/IntConvertTo.java | 3 +- .../expr/fn/impl/conv/IntVIntConvertFrom.java | 3 +- .../expr/fn/impl/conv/IntVIntConvertTo.java | 3 +- .../exec/expr/fn/impl/conv/JsonConvertFrom.java | 5 +- .../exec/expr/fn/impl/conv/JsonConvertTo.java | 3 +- .../fn/impl/conv/SmallIntBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/SmallIntBEConvertTo.java | 3 +- .../expr/fn/impl/conv/SmallIntConvertFrom.java | 3 +- .../expr/fn/impl/conv/SmallIntConvertTo.java | 3 +- .../fn/impl/conv/TimeEpochBEConvertFrom.java | 3 +- .../expr/fn/impl/conv/TimeEpochBEConvertTo.java | 3 +- .../expr/fn/impl/conv/TimeEpochConvertFrom.java | 3 +- .../expr/fn/impl/conv/TimeEpochConvertTo.java | 3 +- .../expr/fn/impl/conv/TinyIntConvertFrom.java | 3 +- .../expr/fn/impl/conv/TinyIntConvertTo.java | 3 +- .../expr/fn/impl/conv/UInt8ConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/UInt8ConvertTo.java | 3 +- .../expr/fn/impl/conv/UTF16ConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/UTF16ConvertTo.java | 3 +- .../exec/expr/fn/impl/conv/UTF8ConvertFrom.java | 3 +- .../exec/expr/fn/impl/conv/UTF8ConvertTo.java | 3 +- .../drill/exec/fn/impl/GeneratorFunctions.java | 11 +- 125 files changed, 369 insertions(+), 442 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/AggrBitwiseLogicalTypeFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/AggrBitwiseLogicalTypeFunctions.java b/exec/java-exec/src/main/codegen/templates/AggrBitwiseLogicalTypeFunctions.java index e659d32..b159421 100644 --- a/exec/java-exec/src/main/codegen/templates/AggrBitwiseLogicalTypeFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/AggrBitwiseLogicalTypeFunctions.java @@ -55,7 +55,6 @@ import org.apache.drill.exec.expr.holders.UInt4Holder; import org.apache.drill.exec.expr.holders.NullableUInt4Holder; import org.apache.drill.exec.expr.holders.UInt8Holder; import org.apache.drill.exec.expr.holders.NullableUInt8Holder; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -75,7 +74,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace ${type.outputType}Holder inter; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { inter = new ${type.outputType}Holder(); // Initialize the workspace variables http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/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 e4386b2..19a6d46 100644 --- a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java +++ b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions1.java @@ -40,7 +40,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -60,7 +59,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu </#if> @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { value = new ${type.runningType}Holder(); <#if type.inputType?starts_with("Nullable") && type.outputType?starts_with("Nullable")> nonNullCount = new BigIntHolder(); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions2.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions2.java b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions2.java index fda1457..6701f09 100644 --- a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions2.java +++ b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions2.java @@ -41,7 +41,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -61,7 +60,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace BigIntHolder nonNullCount; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { sum = new ${type.sumRunningType}Holder(); count = new ${type.countRunningType}Holder(); <#if type.inputType?starts_with("Nullable") > http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions3.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions3.java b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions3.java index acf877a..c005446 100644 --- a/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions3.java +++ b/exec/java-exec/src/main/codegen/templates/AggrTypeFunctions3.java @@ -40,7 +40,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -64,7 +63,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace BigIntHolder nonNullCount; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { avg = new ${type.movingAverageType}Holder(); dev = new ${type.movingDeviationType}Holder(); count = new ${type.countRunningType}Holder(); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastDateDate.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastDateDate.java b/exec/java-exec/src/main/codegen/templates/CastDateDate.java index b849c76..4a72297 100644 --- a/exec/java-exec/src/main/codegen/templates/CastDateDate.java +++ b/exec/java-exec/src/main/codegen/templates/CastDateDate.java @@ -48,7 +48,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastDateVarChar.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastDateVarChar.java b/exec/java-exec/src/main/codegen/templates/CastDateVarChar.java index c261e29..570f367 100644 --- a/exec/java-exec/src/main/codegen/templates/CastDateVarChar.java +++ b/exec/java-exec/src/main/codegen/templates/CastDateVarChar.java @@ -57,7 +57,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer = buffer.reallocIfNeeded((int) len.value); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastFunctions.java b/exec/java-exec/src/main/codegen/templates/CastFunctions.java index 41c1557..4e0b4d2 100644 --- a/exec/java-exec/src/main/codegen/templates/CastFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/CastFunctions.java @@ -45,7 +45,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <#if (type.from.startsWith("Float") && type.to.endsWith("Int"))> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java b/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java index 57740c9..ec543e3 100644 --- a/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java +++ b/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java @@ -51,7 +51,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <#if type.to == "Float4" || type.to == "Float8"> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java b/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java index cd8f7bd..15d4436 100644 --- a/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java +++ b/exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLenTargetVarLen.java @@ -49,7 +49,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param BigIntHolder length; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastFunctionsTargetVarLen.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastFunctionsTargetVarLen.java b/exec/java-exec/src/main/codegen/templates/CastFunctionsTargetVarLen.java index 455ab13..0d6b76a 100644 --- a/exec/java-exec/src/main/codegen/templates/CastFunctionsTargetVarLen.java +++ b/exec/java-exec/src/main/codegen/templates/CastFunctionsTargetVarLen.java @@ -51,7 +51,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastHigh.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastHigh.java b/exec/java-exec/src/main/codegen/templates/CastHigh.java index 934b60b..082417c 100644 --- a/exec/java-exec/src/main/codegen/templates/CastHigh.java +++ b/exec/java-exec/src/main/codegen/templates/CastHigh.java @@ -49,7 +49,7 @@ public class CastHighFunctions { @Output ${type.to}Holder out; </#if> - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <#if type.value > http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastIntervalInterval.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastIntervalInterval.java b/exec/java-exec/src/main/codegen/templates/CastIntervalInterval.java index e85b724..dcc8bc7 100644 --- a/exec/java-exec/src/main/codegen/templates/CastIntervalInterval.java +++ b/exec/java-exec/src/main/codegen/templates/CastIntervalInterval.java @@ -50,7 +50,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -89,7 +89,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastIntervalVarChar.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastIntervalVarChar.java b/exec/java-exec/src/main/codegen/templates/CastIntervalVarChar.java index 829fe47..ebc6005 100644 --- a/exec/java-exec/src/main/codegen/templates/CastIntervalVarChar.java +++ b/exec/java-exec/src/main/codegen/templates/CastIntervalVarChar.java @@ -55,7 +55,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer.reallocIfNeeded(${type.bufferLength}); } @@ -129,7 +129,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer = buffer.reallocIfNeeded((int) len.value); } @@ -189,7 +189,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer = buffer.reallocIfNeeded((int) len.value); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java b/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java index 41c7855..b6c5612 100644 --- a/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java +++ b/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java @@ -51,7 +51,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastVarCharInterval.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastVarCharInterval.java b/exec/java-exec/src/main/codegen/templates/CastVarCharInterval.java index eaebf02..1304f63 100644 --- a/exec/java-exec/src/main/codegen/templates/CastVarCharInterval.java +++ b/exec/java-exec/src/main/codegen/templates/CastVarCharInterval.java @@ -50,7 +50,7 @@ public class Cast${type.from}To${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CastVarCharToNullableNumeric.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CastVarCharToNullableNumeric.java b/exec/java-exec/src/main/codegen/templates/CastVarCharToNullableNumeric.java index e417f26..2b009be 100644 --- a/exec/java-exec/src/main/codegen/templates/CastVarCharToNullableNumeric.java +++ b/exec/java-exec/src/main/codegen/templates/CastVarCharToNullableNumeric.java @@ -51,7 +51,7 @@ public class CastEmptyString${type.from}ToNullable${type.to} implements DrillSim @Param ${type.from}Holder in; @Output Nullable${type.to}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <#if type.to == "Float4" || type.to == "Float8"> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java b/exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java index 011d4d9..aed10a2 100644 --- a/exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/ComparisonFunctions.java @@ -188,7 +188,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { <@compareBlock mode=typeGroup.mode leftType=leftType rightType=rightType @@ -207,7 +207,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { <@compareBlock mode=typeGroup.mode leftType=leftType rightType=rightType @@ -231,7 +231,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { @@ -262,7 +262,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { @@ -293,7 +293,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { @@ -324,7 +324,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { @@ -355,7 +355,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { @@ -388,7 +388,7 @@ public class GCompare${leftTypeBase}Vs${rightTypeBase} { @Param ${rightTypeBase}Holder right; @Output BitHolder out; - public void setup(RecordBatch b) {} + public void setup() {} public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/ConvertToNullableHolder.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/ConvertToNullableHolder.java b/exec/java-exec/src/main/codegen/templates/ConvertToNullableHolder.java index 57efd5e..68595fc 100644 --- a/exec/java-exec/src/main/codegen/templates/ConvertToNullableHolder.java +++ b/exec/java-exec/src/main/codegen/templates/ConvertToNullableHolder.java @@ -42,7 +42,7 @@ public class ${className} implements DrillSimpleFunc { @Param ${minor.class}Holder input; @Output Nullable${minor.class}Holder output; - public void setup(RecordBatch incoming) { } + public void setup() { } public void eval() { output.isSet = 1; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java b/exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java index 19f9c59..2a94730 100644 --- a/exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java @@ -86,7 +86,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace ${type.countRunningType}Holder count; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { xMean = new ${type.movingAverageType}Holder(); yMean = new ${type.movingAverageType}Holder(); xyMean = new ${type.movingDeviationType}Holder(); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/CovarTypeFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/CovarTypeFunctions.java b/exec/java-exec/src/main/codegen/templates/CovarTypeFunctions.java index b8131c2..e3d2f4a 100644 --- a/exec/java-exec/src/main/codegen/templates/CovarTypeFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/CovarTypeFunctions.java @@ -88,7 +88,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace ${type.countRunningType}Holder count; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { xMean = new ${type.movingAverageType}Holder(); yMean = new ${type.movingAverageType}Holder(); xyMean = new ${type.movingDeviationType}Holder(); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalAggrFunctions1.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalAggrFunctions1.java b/exec/java-exec/src/main/codegen/templates/DateIntervalAggrFunctions1.java index 1c9b76f..56e37ce 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalAggrFunctions1.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalAggrFunctions1.java @@ -40,7 +40,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -55,7 +54,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace ${type.runningType}Holder value; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { value = new ${type.runningType}Holder(); <#if type.runningType == "Interval"> value.months = ${type.initialValue}; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java index 6c03f3b..a550a69 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java @@ -50,7 +50,7 @@ public static class G${type}Difference implements DrillSimpleFunc { @Param ${type}Holder right; @Output IntervalDayHolder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateIntervalArithmeticFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateIntervalArithmeticFunctions.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateIntervalArithmeticFunctions.java index 0b0da52..87470d5 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateIntervalArithmeticFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateIntervalArithmeticFunctions.java @@ -94,7 +94,7 @@ public class ${datetype}${intervaltype}Functions { @Output ${datetype}Holder out; </#if> - public void setup(RecordBatch incoming) { + public void setup() { <#if datetype == "TimeStampTZ"> temp = new org.joda.time.MutableDateTime(org.joda.time.DateTimeZone.forID(org.apache.drill.exec.expr.fn.impl.DateUtility.timezoneList[left.index])); <#else> @@ -120,7 +120,7 @@ public class ${datetype}${intervaltype}Functions { <#else> @Output ${datetype}Holder out; </#if> - public void setup(RecordBatch incoming) { + public void setup() { <#if datetype == "TimeStampTZ"> temp = new org.joda.time.MutableDateTime(org.joda.time.DateTimeZone.forID(org.apache.drill.exec.expr.fn.impl.DateUtility.timezoneList[left.index])); <#else> @@ -142,7 +142,7 @@ public class ${datetype}${intervaltype}Functions { @Workspace org.joda.time.MutableDateTime temp; @Output ${datetype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { <#if datetype == "TimeStampTZ"> temp = new org.joda.time.MutableDateTime(org.joda.time.DateTimeZone.forID(org.apache.drill.exec.expr.fn.impl.DateUtility.timezoneList[left.index])); <#else> @@ -200,7 +200,7 @@ public class ${datetype}${intervaltype}Functions { @Param ${intervaltype}Holder right; @Output ${datetype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -215,7 +215,7 @@ public class ${datetype}${intervaltype}Functions { @Param ${datetype}Holder left; @Output ${datetype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { <@timeIntervalArithmeticBlock left="left" right="right" temp = "temp" op = "+" output="out.value" intervaltype=intervaltype /> @@ -229,7 +229,7 @@ public class ${datetype}${intervaltype}Functions { @Param ${intervaltype}Holder right; @Output ${datetype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateToCharFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateToCharFunctions.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateToCharFunctions.java index 695cfcf..4cf63dc 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateToCharFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateToCharFunctions.java @@ -53,7 +53,7 @@ public class G${type}ToChar implements DrillSimpleFunc { @Workspace org.joda.time.format.DateTimeFormatter format; @Output VarCharHolder out; - public void setup(RecordBatch b) { + public void setup() { temp = new org.joda.time.MutableDateTime(0, org.joda.time.DateTimeZone.UTC); buffer = buffer.reallocIfNeeded(100); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateTruncFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateTruncFunctions.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateTruncFunctions.java index b9cd0c8..4c60c25 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateTruncFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateTruncFunctions.java @@ -50,7 +50,7 @@ public static class G${type}DateTrunc implements DrillSimpleFunc { @Output ${type}Holder out; @Workspace org.joda.time.MutableDateTime dateTime; - public void setup(RecordBatch incoming) { + public void setup() { dateTime = new org.joda.time.MutableDateTime(org.joda.time.DateTimeZone.UTC); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java index 0858c3f..857fece 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java @@ -47,7 +47,7 @@ public class ${className} { </#if> @Workspace org.joda.time.MutableDateTime dateTime; - public void setup(RecordBatch incoming) { + public void setup() { dateTime = new org.joda.time.MutableDateTime(org.joda.time.DateTimeZone.UTC); } @@ -87,7 +87,7 @@ public class ${className} { @Output BigIntHolder out; </#if> - public void setup(RecordBatch incoming) { } + public void setup() { } public void eval() { <#if fromUnit == "Interval"> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java index 484c8f4..3a343e5 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java @@ -51,7 +51,7 @@ public class ${intervaltype}Functions { @Param ${intervaltype}Holder right; @Output ${intervaltype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -75,7 +75,7 @@ public class ${intervaltype}Functions { @Param ${intervaltype}Holder right; @Output ${intervaltype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -97,7 +97,7 @@ public class ${intervaltype}Functions { @Param ${intervaltype}Holder left; @Output ${intervaltype}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java index ce73f74..8198ce6 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java @@ -96,7 +96,7 @@ public class ${intervaltype}${numerictype}Functions { @Param ${numerictype}Holder right; @Output IntervalHolder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -115,7 +115,7 @@ public class ${intervaltype}${numerictype}Functions { @Param ${intervaltype}Holder left; @Output IntervalHolder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -134,7 +134,7 @@ public class ${intervaltype}${numerictype}Functions { @Param ${numerictype}Holder right; @Output IntervalHolder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToDateTypeFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToDateTypeFunctions.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToDateTypeFunctions.java index fffaef4..baba963 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToDateTypeFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToDateTypeFunctions.java @@ -46,7 +46,7 @@ public class GTo${type} implements DrillSimpleFunc { @Workspace org.joda.time.format.DateTimeFormatter format; @Output ${type}Holder out; - public void setup(RecordBatch b) { + public void setup() { // Get the desired output format byte[] buf = new byte[right.end - right.start]; right.buffer.getBytes(right.start, buf, 0, right.end - right.start); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToTimeStampFunction.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToTimeStampFunction.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToTimeStampFunction.java index 4fd619f..4d1d093 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToTimeStampFunction.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/ToTimeStampFunction.java @@ -49,7 +49,7 @@ public class G${numerics}ToTimeStamp implements DrillSimpleFunc { </#if> @Output TimeStampHolder out; - public void setup(RecordBatch b) { + public void setup() { <#if numerics.startsWith("Decimal")> millisConstant = java.math.BigInteger.valueOf(1000); </#if> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalDenseDecimalSparse.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalDenseDecimalSparse.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalDenseDecimalSparse.java index cb0dc58..4713041 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalDenseDecimalSparse.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalDenseDecimalSparse.java @@ -52,7 +52,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalFloat.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalFloat.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalFloat.java index 4d8d1a5..c85cc4f 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalFloat.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalFloat.java @@ -46,7 +46,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -84,7 +84,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalInt.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalInt.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalInt.java index c435f6d..318a8d8 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalInt.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalInt.java @@ -49,7 +49,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -89,7 +89,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param ${type.from}Holder in; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSimilar.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSimilar.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSimilar.java index cd2c390..f9b7430 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSimilar.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSimilar.java @@ -54,7 +54,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSparseDecimalDense.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSparseDecimalDense.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSparseDecimalDense.java index 0f8790f..a94eb12 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSparseDecimalDense.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalSparseDecimalDense.java @@ -52,7 +52,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalVarchar.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalVarchar.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalVarchar.java index ed62444..d9d15e1 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalVarchar.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDecimalVarchar.java @@ -55,7 +55,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer = buffer.reallocIfNeeded(${type.bufferSize}); } @@ -136,7 +136,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { buffer = buffer.reallocIfNeeded((int) len.value); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastDownwardDecimal.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastDownwardDecimal.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastDownwardDecimal.java index bd86819..05c9936 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastDownwardDecimal.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastDownwardDecimal.java @@ -52,7 +52,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -125,7 +125,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -169,7 +169,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Inject DrillBuf buffer; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastFloatDecimal.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastFloatDecimal.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastFloatDecimal.java index c05b2e5..8a7919c 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastFloatDecimal.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastFloatDecimal.java @@ -58,7 +58,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { <#if type.major == "FloatDecimalComplex" || type.major == "DoubleDecimalComplex"> int size = ${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize); buffer = buffer.reallocIfNeeded(size); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastIntDecimal.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastIntDecimal.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastIntDecimal.java index 139fff8..2393db8 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastIntDecimal.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastIntDecimal.java @@ -54,7 +54,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { <#if type.to.startsWith("Decimal28") || type.to.startsWith("Decimal38")> int size = ${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize); buffer = buffer.reallocIfNeeded(size); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastSrcDecimalSimple.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastSrcDecimalSimple.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastSrcDecimalSimple.java index 7750c62..40b03a1 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastSrcDecimalSimple.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastSrcDecimalSimple.java @@ -56,7 +56,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } @@ -158,7 +158,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc{ @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); } @@ -257,7 +257,7 @@ public class Cast${type.from}${type.to} implements DrillSimpleFunc { @Param BigIntHolder scale; @Output ${type.to}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java b/exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java index 84be392..53c0cf9 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/CastVarCharDecimal.java @@ -66,7 +66,7 @@ public class CastEmptyString${type.from}ToNullable${type.to} implements DrillSim @Output Nullable${type.to}Holder out; </#if> - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -240,7 +240,7 @@ public class CastEmptyString${type.from}ToNullable${type.to} implements DrillSim @Output Nullable${type.to}Holder out; </#if> - public void setup(RecordBatch incoming) { + public void setup() { int size = ${type.arraySize} * (org.apache.drill.exec.util.DecimalUtility.integerSize); buffer = buffer.reallocIfNeeded(size); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions1.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions1.java b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions1.java index 54cec10..974db9b 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions1.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions1.java @@ -74,7 +74,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu </#if> @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { <#if aggrtype.funcName == "count"> value = new ${type.runningType}Holder(); value.value = 0; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java index 7277e19..5a1b04a 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java @@ -65,7 +65,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace IntHolder outputScale; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { buffer.reallocIfNeeded(${type.outputType}Holder.WIDTH); value = new ObjectHolder(); value.obj = java.math.BigDecimal.ZERO; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java index b9029cd..8d5f1a3 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java @@ -140,7 +140,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.storage} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); outputPrecision = Integer.MIN_VALUE; @@ -178,7 +178,7 @@ public class ${type.name}Functions { @Inject DrillBuf buffer; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.storage} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); outputPrecision = Integer.MIN_VALUE; @@ -217,7 +217,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.storage} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); tempResult = new int[${type.storage} * ${type.storage}]; @@ -386,7 +386,7 @@ public class ${type.name}Functions { @Workspace int outputScale; @Workspace int outputPrecision; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.storage} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); outputPrecision = Integer.MIN_VALUE; @@ -423,7 +423,7 @@ public class ${type.name}Functions { @Workspace int outputScale; @Workspace int outputPrecision; - public void setup(RecordBatch incoming) { + public void setup() { int size = (${type.storage} * (org.apache.drill.exec.util.DecimalUtility.integerSize)); buffer = buffer.reallocIfNeeded(size); outputPrecision = Integer.MIN_VALUE; @@ -456,7 +456,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -477,7 +477,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { @@ -502,7 +502,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -568,7 +568,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -633,7 +633,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -668,7 +668,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param IntHolder right; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -744,7 +744,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -807,7 +807,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param IntHolder right; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -839,7 +839,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@compareBlock leftType=leftType rightType=rightType absCompare="false" output="out.value" nullCompare=true nullComparesHigh=true /> @@ -859,7 +859,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@compareBlock leftType=leftType rightType=rightType absCompare="false" output="out.value" nullCompare=true nullComparesHigh=false /> @@ -880,7 +880,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -902,7 +902,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -922,7 +922,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -942,7 +942,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -962,7 +962,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -982,7 +982,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp; @@ -1034,7 +1034,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { outside: @@ -1057,7 +1057,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { outside: @@ -1083,7 +1083,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp = org.apache.drill.exec.util.DecimalUtility.compareDenseBytes(left.buffer, left.start, left.getSign(left.start, left.buffer), right.buffer, right.start, right.getSign(right.start, right.buffer), left.WIDTH); @@ -1101,7 +1101,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp = org.apache.drill.exec.util.DecimalUtility.compareDenseBytes(left.buffer, left.start, left.getSign(left.start, left.buffer), right.buffer, right.start, right.getSign(right.start, right.buffer), left.WIDTH); @@ -1119,7 +1119,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp = org.apache.drill.exec.util.DecimalUtility.compareDenseBytes(left.buffer, left.start, left.getSign(left.start, left.buffer), right.buffer, right.start, right.getSign(right.start, right.buffer), left.WIDTH); @@ -1137,7 +1137,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp = org.apache.drill.exec.util.DecimalUtility.compareDenseBytes(left.buffer, left.start, left.getSign(left.start, left.buffer), right.buffer, right.start, right.getSign(right.start, right.buffer), left.WIDTH); @@ -1155,7 +1155,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { int cmp = org.apache.drill.exec.util.DecimalUtility.compareDenseBytes(left.buffer, left.start, left.getSign(left.start, left.buffer), right.buffer, right.start, right.getSign(right.start, right.buffer), left.WIDTH); @@ -1174,7 +1174,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { @@ -1220,7 +1220,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { outputPrecision = Integer.MIN_VALUE; } @@ -1249,7 +1249,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { outputPrecision = Integer.MIN_VALUE; } @@ -1276,7 +1276,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { outputPrecision = Integer.MIN_VALUE; } @@ -1299,7 +1299,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { out.precision = out.maxPrecision; @@ -1322,7 +1322,7 @@ public class ${type.name}Functions { @Workspace int outputScale; @Workspace int outputPrecision; - public void setup(RecordBatch incoming) { + public void setup() { outputPrecision = Integer.MIN_VALUE; } @@ -1355,7 +1355,7 @@ public class ${type.name}Functions { @Workspace int outputPrecision; @Output ${type.name}Holder result; - public void setup(RecordBatch incoming) { + public void setup() { outputPrecision = Integer.MIN_VALUE; } @@ -1384,7 +1384,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { @@ -1398,7 +1398,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { @@ -1415,7 +1415,7 @@ public class ${type.name}Functions { @Param IntHolder right; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { @@ -1431,7 +1431,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } @@ -1458,7 +1458,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -1483,7 +1483,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder in; @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -1520,7 +1520,7 @@ public class ${type.name}Functions { @Output ${type.name}Holder out; - public void setup(RecordBatch incoming) { + public void setup() { } public void eval() { @@ -1578,7 +1578,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { outside: @@ -1602,7 +1602,7 @@ public class ${type.name}Functions { @Param ${rightType}Holder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { outside: @@ -1627,7 +1627,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> @@ -1645,7 +1645,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> @@ -1663,7 +1663,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> @@ -1681,7 +1681,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> @@ -1699,7 +1699,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> @@ -1718,7 +1718,7 @@ public class ${type.name}Functions { @Param ${type.name}Holder left; @Param ${type.name}Holder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { <@adjustScale javaType=type.storage leftType="leftType" rightType="rightType"/> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/IntervalAggrFunctions2.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/IntervalAggrFunctions2.java b/exec/java-exec/src/main/codegen/templates/IntervalAggrFunctions2.java index c7f5918..b29fa08 100644 --- a/exec/java-exec/src/main/codegen/templates/IntervalAggrFunctions2.java +++ b/exec/java-exec/src/main/codegen/templates/IntervalAggrFunctions2.java @@ -41,7 +41,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -60,7 +59,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu @Workspace ${type.countRunningType}Holder count; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { sum = new ${type.sumRunningType}Holder(); count = new ${type.countRunningType}Holder(); sum.value = 0; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/MathFunctionTemplates.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/MathFunctionTemplates.java b/exec/java-exec/src/main/codegen/templates/MathFunctionTemplates.java index 9ec2178..a1e0375 100644 --- a/exec/java-exec/src/main/codegen/templates/MathFunctionTemplates.java +++ b/exec/java-exec/src/main/codegen/templates/MathFunctionTemplates.java @@ -58,7 +58,7 @@ public class ${inputType.className}Functions { @Param ${type.input2}Holder in2; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/MathFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/MathFunctions.java b/exec/java-exec/src/main/codegen/templates/MathFunctions.java index fa5f1ac..ba5b76c 100644 --- a/exec/java-exec/src/main/codegen/templates/MathFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/MathFunctions.java @@ -62,7 +62,7 @@ public class GMathFunctions{ @Param ${type.input}Holder in; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { @@ -97,7 +97,7 @@ public class GMathFunctions{ @Param ${type.input}Holder input2; @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { @@ -128,7 +128,7 @@ public class GMathFunctions{ @Param IntHolder input2; @Output Float8Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { @@ -198,7 +198,7 @@ public static class ${func.className}${type.input} implements DrillSimpleFunc { @Param ${type.input}Holder in; @Output ${func.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { @@ -228,7 +228,7 @@ public static class ${func.className}${type.input} implements DrillSimpleFunc { @Param ${type.input}Holder val; @Output ${func.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { @@ -297,7 +297,7 @@ public class TrigoMathFunctions{ @Param ${type.input}Holder in; @Output ${func.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { } public void eval() { http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/NullOperator.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/NullOperator.java b/exec/java-exec/src/main/codegen/templates/NullOperator.java index 73eda1a..1c9ad32 100644 --- a/exec/java-exec/src/main/codegen/templates/NullOperator.java +++ b/exec/java-exec/src/main/codegen/templates/NullOperator.java @@ -41,7 +41,7 @@ public class ${className} { @Param ${mode.prefix}${minor.class}Holder input; @Output BitHolder out; - public void setup(RecordBatch incoming) { } + public void setup() { } public void eval() { <#if mode.name == "Optional"> @@ -58,7 +58,7 @@ public class ${className} { @Param ${mode.prefix}${minor.class}Holder input; @Output BitHolder out; - public void setup(RecordBatch incoming) { } + public void setup() { } public void eval() { <#if mode.name == "Optional"> http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java b/exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java index 65ac923..4d06c68 100644 --- a/exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java +++ b/exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java @@ -81,7 +81,7 @@ public static class ${type.inputType}${numericFunc.className} implements DrillSi @Workspace java.util.regex.Matcher matcher; </#if> - public void setup(RecordBatch b) { + public void setup() { <#if type.intype != "numeric"> pattern = java.util.regex.Pattern.compile("[-+]?\\d+(\\.\\d+)?"); matcher = pattern.matcher(""); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/NumericToCharFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/NumericToCharFunctions.java b/exec/java-exec/src/main/codegen/templates/NumericToCharFunctions.java index ff2c675..8bfe512 100644 --- a/exec/java-exec/src/main/codegen/templates/NumericToCharFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/NumericToCharFunctions.java @@ -55,7 +55,7 @@ public class G${type}ToChar implements DrillSimpleFunc { @Workspace java.text.NumberFormat outputFormat; @Output VarCharHolder out; - public void setup(RecordBatch b) { + public void setup() { buffer = buffer.reallocIfNeeded(100); byte[] buf = new byte[right.end - right.start]; right.buffer.getBytes(right.start, buf, 0, right.end - right.start); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java b/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java index 5b0c4a0..87393f7 100644 --- a/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java +++ b/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java @@ -37,7 +37,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.*; -import org.apache.drill.exec.record.RecordBatch; @SuppressWarnings("unused") @@ -54,7 +53,7 @@ public class SumZeroFunctions { @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { value.value = 0; } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/codegen/templates/VarCharAggrFunctions1.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/VarCharAggrFunctions1.java b/exec/java-exec/src/main/codegen/templates/VarCharAggrFunctions1.java index 01b5565..53474ea 100644 --- a/exec/java-exec/src/main/codegen/templates/VarCharAggrFunctions1.java +++ b/exec/java-exec/src/main/codegen/templates/VarCharAggrFunctions1.java @@ -69,7 +69,7 @@ public static class ${type.inputType}${aggrtype.className} implements DrillAggFu </#if> @Output ${type.outputType}Holder out; - public void setup(RecordBatch b) { + public void setup() { <#if aggrtype.funcName == "max" || aggrtype.funcName == "min"> init = new UInt1Holder(); init.value = 0; http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillAggFunc.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillAggFunc.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillAggFunc.java index b29410d..21599f6 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillAggFunc.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillAggFunc.java @@ -19,8 +19,16 @@ package org.apache.drill.exec.expr; import org.apache.drill.exec.record.RecordBatch; +/** + * Aggregate function interface. + * + */ public interface DrillAggFunc extends DrillFunc{ - public void setup(RecordBatch incoming); + /** + * Initialization for the beginning of the aggregation. + * + */ + public void setup(); public void add(); public void output(); public void reset(); http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillSimpleFunc.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillSimpleFunc.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillSimpleFunc.java index 8821c63..40817f2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillSimpleFunc.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/DrillSimpleFunc.java @@ -20,6 +20,6 @@ package org.apache.drill.exec.expr; import org.apache.drill.exec.record.RecordBatch; public interface DrillSimpleFunc extends DrillFunc{ - public void setup(RecordBatch incoming); + public void setup(); public void eval(); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/AggregateErrorFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/AggregateErrorFunctions.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/AggregateErrorFunctions.java index 48a6625..a95a1c3 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/AggregateErrorFunctions.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/AggregateErrorFunctions.java @@ -25,7 +25,6 @@ import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.BigIntHolder; import org.apache.drill.exec.expr.holders.BitHolder; import org.apache.drill.exec.expr.holders.NullableBitHolder; -import org.apache.drill.exec.record.RecordBatch; public class AggregateErrorFunctions { @@ -36,7 +35,7 @@ public class AggregateErrorFunctions { @Workspace BigIntHolder value; @Output BigIntHolder out; - public void setup(RecordBatch b) { + public void setup() { if (true) { throw new RuntimeException("Only COUNT aggregate function supported for Boolean type"); } @@ -63,7 +62,7 @@ public class AggregateErrorFunctions { @Workspace BigIntHolder value; @Output BigIntHolder out; - public void setup(RecordBatch b) { + public void setup() { if (true) { throw new RuntimeException("Only COUNT aggregate function supported for Boolean type"); } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java index 9350429..fc880f2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java @@ -23,7 +23,6 @@ import org.apache.drill.exec.expr.annotations.FunctionTemplate.FunctionScope; import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Workspace; import org.apache.drill.exec.expr.holders.BigIntHolder; -import org.apache.drill.exec.record.RecordBatch; public class Alternator { @@ -32,7 +31,7 @@ public class Alternator { @Workspace int val; @Output BigIntHolder out; - public void setup(RecordBatch incoming) { + public void setup() { val = 0; } @@ -52,7 +51,7 @@ public class Alternator { @Workspace int val; @Output BigIntHolder out; - public void setup(RecordBatch incoming) { + public void setup() { val = 0; } http://git-wip-us.apache.org/repos/asf/drill/blob/bff7b9ef/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java index ae42872..c44a6b7 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/BitFunctions.java @@ -25,7 +25,6 @@ import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.holders.BitHolder; import org.apache.drill.exec.expr.holders.IntHolder; -import org.apache.drill.exec.record.RecordBatch; /** * Function templates for Bit/BOOLEAN functions other than comparison @@ -44,7 +43,7 @@ public class BitFunctions { @Param BitHolder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { out.value = left.value | right.value; @@ -60,7 +59,7 @@ public class BitFunctions { @Param BitHolder right; @Output BitHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { out.value = left.value & right.value; @@ -77,7 +76,7 @@ public class BitFunctions { @Param IntHolder right; @Output IntHolder out; - public void setup(RecordBatch incoming) {} + public void setup() {} public void eval() { out.value = left.value ^ right.value;
