From aac901e0282c0d34624c80143f92b945d1b75fb7 Mon Sep 17 00:00:00 2001 From: Tony Murphy Date: Fri, 2 Aug 2013 13:58:01 -0700 Subject: [PATCH] refactor vector generation --- .../ColumnArithmeticColumn.txt | 0 .../ColumnArithmeticScalar.txt | 0 .../ExpressionTemplates}/ColumnCompareScalar.txt | 0 .../ExpressionTemplates}/ColumnUnaryMinus.txt | 0 .../FilterColumnCompareColumn.txt | 0 .../FilterColumnCompareScalar.txt | 0 .../FilterScalarCompareColumn.txt | 0 .../FilterStringColumnCompareColumn.txt | 0 .../FilterStringColumnCompareScalar.txt | 0 .../FilterStringScalarCompareColumn.txt | 0 .../ScalarArithmeticColumn.txt | 0 .../vectorization/TestTemplates}/TestClass.txt | 0 ...olumnColumnFilterVectorExpressionEvaluation.txt | 0 ...mnColumnOperationVectorExpressionEvaluation.txt | 0 ...olumnScalarFilterVectorExpressionEvaluation.txt | 14 +- ...mnScalarOperationVectorExpressionEvaluation.txt | 0 .../vectorization/UDAFTemplates}/VectorUDAFAvg.txt | 0 .../UDAFTemplates}/VectorUDAFMinMax.txt | 0 .../UDAFTemplates}/VectorUDAFMinMaxString.txt | 0 .../vectorization/UDAFTemplates}/VectorUDAFSum.txt | 0 .../vectorization/UDAFTemplates}/VectorUDAFVar.txt | 0 .../hadoop/hive/ql/exec/vector/gen}/CodeGen.java | 97 +- .../hive/ql/exec/vector/gen}/TestCodeGen.java | 24 +- ...nColumnOperationVectorExpressionEvaluation.java | 114 + ...lumnScalarFilterVectorExpressionEvaluation.java | 6624 +++++++++++++++++++- 25 files changed, 6622 insertions(+), 251 deletions(-) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/ColumnArithmeticColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/ColumnArithmeticScalar.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/ColumnCompareScalar.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/ColumnUnaryMinus.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterColumnCompareColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterColumnCompareScalar.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterScalarCompareColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterStringColumnCompareColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterStringColumnCompareScalar.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/FilterStringScalarCompareColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/ExpressionTemplates}/ScalarArithmeticColumn.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/TestTemplates}/TestClass.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/TestTemplates}/TestColumnColumnFilterVectorExpressionEvaluation.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/TestTemplates}/TestColumnColumnOperationVectorExpressionEvaluation.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/TestTemplates}/TestColumnScalarFilterVectorExpressionEvaluation.txt (86%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/TestTemplates}/TestColumnScalarOperationVectorExpressionEvaluation.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/UDAFTemplates}/VectorUDAFAvg.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/UDAFTemplates}/VectorUDAFMinMax.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/UDAFTemplates}/VectorUDAFMinMaxString.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/UDAFTemplates}/VectorUDAFSum.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/UDAFTemplates}/VectorUDAFVar.txt (100%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen}/CodeGen.java (91%) rename ql/src/{java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates => gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen}/TestCodeGen.java (91%) diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt ql/src/gen/vectorization/ExpressionTemplates/ColumnArithmeticColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/ColumnArithmeticColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt ql/src/gen/vectorization/ExpressionTemplates/ColumnArithmeticScalar.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnArithmeticScalar.txt rename to ql/src/gen/vectorization/ExpressionTemplates/ColumnArithmeticScalar.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt ql/src/gen/vectorization/ExpressionTemplates/ColumnCompareScalar.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnCompareScalar.txt rename to ql/src/gen/vectorization/ExpressionTemplates/ColumnCompareScalar.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt ql/src/gen/vectorization/ExpressionTemplates/ColumnUnaryMinus.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ColumnUnaryMinus.txt rename to ql/src/gen/vectorization/ExpressionTemplates/ColumnUnaryMinus.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterColumnCompareScalar.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterColumnCompareScalar.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterScalarCompareColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterScalarCompareColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareColumn.txt ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnCompareColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnCompareColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnCompareScalar.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringColumnCompareScalar.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterStringColumnCompareScalar.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/FilterStringScalarCompareColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/FilterStringScalarCompareColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt ql/src/gen/vectorization/ExpressionTemplates/ScalarArithmeticColumn.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/ScalarArithmeticColumn.txt rename to ql/src/gen/vectorization/ExpressionTemplates/ScalarArithmeticColumn.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestClass.txt ql/src/gen/vectorization/TestTemplates/TestClass.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestClass.txt rename to ql/src/gen/vectorization/TestTemplates/TestClass.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnColumnFilterVectorExpressionEvaluation.txt ql/src/gen/vectorization/TestTemplates/TestColumnColumnFilterVectorExpressionEvaluation.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnColumnFilterVectorExpressionEvaluation.txt rename to ql/src/gen/vectorization/TestTemplates/TestColumnColumnFilterVectorExpressionEvaluation.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnColumnOperationVectorExpressionEvaluation.txt ql/src/gen/vectorization/TestTemplates/TestColumnColumnOperationVectorExpressionEvaluation.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnColumnOperationVectorExpressionEvaluation.txt rename to ql/src/gen/vectorization/TestTemplates/TestColumnColumnOperationVectorExpressionEvaluation.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnScalarFilterVectorExpressionEvaluation.txt ql/src/gen/vectorization/TestTemplates/TestColumnScalarFilterVectorExpressionEvaluation.txt similarity index 86% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnScalarFilterVectorExpressionEvaluation.txt rename to ql/src/gen/vectorization/TestTemplates/TestColumnScalarFilterVectorExpressionEvaluation.txt index 5b53d6a..af30490 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnScalarFilterVectorExpressionEvaluation.txt +++ ql/src/gen/vectorization/TestTemplates/TestColumnScalarFilterVectorExpressionEvaluation.txt @@ -32,25 +32,27 @@ } while(scalarValue == 0); vectorExpression = - new (); + new (0, scalarValue); vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] scalarValue + !inputColumnVector.isNull[i] && ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { - if(inputColumnVector.vector[i] scalarValue) { + if( ) { assertEquals( "Vector index that passes filter " - + inputColumnVector.vector[i] + "" - + scalarValue + " is not in rowBatch selected index", + + + "" + + + " is not in rowBatch selected index", i, rowBatch.selected[selectedIndex]); selectedIndex++; diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnScalarOperationVectorExpressionEvaluation.txt ql/src/gen/vectorization/TestTemplates/TestColumnScalarOperationVectorExpressionEvaluation.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestColumnScalarOperationVectorExpressionEvaluation.txt rename to ql/src/gen/vectorization/TestTemplates/TestColumnScalarOperationVectorExpressionEvaluation.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt ql/src/gen/vectorization/UDAFTemplates/VectorUDAFAvg.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFAvg.txt rename to ql/src/gen/vectorization/UDAFTemplates/VectorUDAFAvg.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt ql/src/gen/vectorization/UDAFTemplates/VectorUDAFMinMax.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMax.txt rename to ql/src/gen/vectorization/UDAFTemplates/VectorUDAFMinMax.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt ql/src/gen/vectorization/UDAFTemplates/VectorUDAFMinMaxString.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFMinMaxString.txt rename to ql/src/gen/vectorization/UDAFTemplates/VectorUDAFMinMaxString.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt ql/src/gen/vectorization/UDAFTemplates/VectorUDAFSum.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFSum.txt rename to ql/src/gen/vectorization/UDAFTemplates/VectorUDAFSum.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt ql/src/gen/vectorization/UDAFTemplates/VectorUDAFVar.txt similarity index 100% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/VectorUDAFVar.txt rename to ql/src/gen/vectorization/UDAFTemplates/VectorUDAFVar.txt diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/CodeGen.java similarity index 91% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java rename to ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/CodeGen.java index a4c1999..4a4b0a9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/CodeGen.java +++ ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/CodeGen.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.hive.ql.exec.vector.expressions.templates; +package org.apache.hadoop.hive.ql.exec.vector.gen; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -267,8 +267,10 @@ }; - private final String templateDirectory; - private final String outputDirectory; + private final String expressionOutputDirectory; + private final String expressionTemplateDirectory; + private final String udafOutputDirectory; + private final String udafTemplateDirectory; private final TestCodeGen testCodeGen; static String joinPath(String...parts) { @@ -280,16 +282,35 @@ static String joinPath(String...parts) { } public CodeGen() { - templateDirectory = System.getProperty("user.dir"); - File f = new File(templateDirectory); - outputDirectory = joinPath(f.getParent(), "gen"); - testCodeGen = new TestCodeGen(joinPath(f.getParent(), "test"), templateDirectory); - } - - public CodeGen(String templateDirectory, String outputDirectory, String testOutputDirectory) { - this.templateDirectory = templateDirectory; - this.outputDirectory = outputDirectory; - testCodeGen = new TestCodeGen(testOutputDirectory, templateDirectory); + File generationDirectory = new File(System.getProperty("user.dir")); + + expressionOutputDirectory = + new File( + joinPath( + generationDirectory.getAbsolutePath(),"..", "..", "java", "org", + "apache", "hadoop", "hive", "ql", "exec", "vector", + "expressions", "gen")).getAbsolutePath(); + + expressionTemplateDirectory = + joinPath(generationDirectory.getAbsolutePath(), "ExpressionTemplates"); + + udafOutputDirectory = + new File( + joinPath( + generationDirectory.getAbsolutePath(),"..", "..", "java", "org", + "apache", "hadoop", "hive", "ql", "exec", "vector", + "expressions", "aggregates", "gen")).getAbsolutePath(); + + udafTemplateDirectory = + joinPath(generationDirectory.getAbsolutePath(), "udafTemplates"); + + testCodeGen = new TestCodeGen( + new File( + joinPath( + generationDirectory.getAbsolutePath(), "..", "..","test", "org", + "apache", "hadoop", "hive", "ql", "exec", "vector", + "expressions", "gen")).getAbsolutePath(), + joinPath(generationDirectory.getAbsolutePath(), "TestTemplates")); } /** @@ -297,15 +318,7 @@ public CodeGen(String templateDirectory, String outputDirectory, String testOutp * @throws Exception */ public static void main(String[] args) throws Exception { - CodeGen gen; - if (args == null || args.length==0) { - gen = new CodeGen(); - } else if (args.length==3) { - gen = new CodeGen(args[0], args[1], args[2]); - }else{ - System.out.println("args: "); - return; - } + CodeGen gen = new CodeGen(); gen.generate(); } @@ -361,8 +374,8 @@ private void generateVectorUDAFMinMax(String[] tdesc) throws Exception { String writableType = getOutputWritableType(valueType); String inspectorType = getOutputObjectInspector(valueType); - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.udafOutputDirectory, className + ".java"); + String templateFile = joinPath(this.udafTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); @@ -383,8 +396,8 @@ private void generateVectorUDAFMinMaxString(String[] tdesc) throws Exception { String descName = tdesc[3]; String descValue = tdesc[4]; - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.udafOutputDirectory, className + ".java"); + String templateFile = joinPath(this.udafTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); @@ -403,8 +416,8 @@ private void generateVectorUDAFSum(String[] tdesc) throws Exception { String writableType = getOutputWritableType(valueType); String inspectorType = getOutputObjectInspector(valueType); - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.udafOutputDirectory, className + ".java"); + String templateFile = joinPath(this.udafTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); @@ -420,8 +433,8 @@ private void generateVectorUDAFAvg(String[] tdesc) throws IOException { String valueType = tdesc[2]; String columnType = getColumnVectorType(valueType); - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.udafOutputDirectory, className + ".java"); + String templateFile = joinPath(this.udafTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); @@ -438,8 +451,8 @@ private void generateVectorUDAFVar(String[] tdesc) throws IOException { String descriptionValue = tdesc[5]; String columnType = getColumnVectorType(valueType); - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.udafOutputDirectory, className + ".java"); + String templateFile = joinPath(this.udafTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); @@ -474,9 +487,9 @@ private void generateFilterStringColumnCompareColumn(String[] tdesc) throws IOEx private void generateFilterStringColumnCompareScalar(String[] tdesc, String className) throws IOException { String operatorSymbol = tdesc[2]; - String outputFile = joinPath(this.outputDirectory, className + ".java"); + String outputFile = joinPath(this.expressionOutputDirectory, className + ".java"); // Read the template into a string; - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); // Expand, and write result templateString = templateString.replaceAll("", className); @@ -501,8 +514,8 @@ private void generateColumnUnaryMinus(String[] tdesc) throws IOException { String outputColumnVectorType = inputColumnVectorType; String returnType = operandType; String className = getCamelCaseType(operandType) + "ColUnaryMinus"; - String outputFile = joinPath(this.outputDirectory, className + ".java"); - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String outputFile = joinPath(this.expressionOutputDirectory, className + ".java"); + String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); // Expand, and write result templateString = templateString.replaceAll("", className); @@ -562,10 +575,10 @@ private void generateColumnBinaryOperatorColumn(String[] tdesc, String returnTyp String inputColumnVectorType1 = this.getColumnVectorType(operandType1); String inputColumnVectorType2 = this.getColumnVectorType(operandType2); String operatorSymbol = tdesc[4]; - String outputFile = joinPath(this.outputDirectory, className + ".java"); + String outputFile = joinPath(this.expressionOutputDirectory, className + ".java"); //Read the template into a string; - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); templateString = templateString.replaceAll("", inputColumnVectorType1); @@ -600,10 +613,10 @@ private void generateColumnBinaryOperatorScalar(String[] tdesc, String returnTyp String outputColumnVectorType = this.getColumnVectorType(returnType); String inputColumnVectorType = this.getColumnVectorType(operandType1); String operatorSymbol = tdesc[4]; - String outputFile = joinPath(this.outputDirectory, className + ".java"); + String outputFile = joinPath(this.expressionOutputDirectory, className + ".java"); //Read the template into a string; - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); templateString = templateString.replaceAll("", inputColumnVectorType); @@ -638,10 +651,10 @@ private void generateScalarBinaryOperatorColumn(String[] tdesc, String returnTyp String outputColumnVectorType = this.getColumnVectorType(returnType); String inputColumnVectorType = this.getColumnVectorType(operandType2); String operatorSymbol = tdesc[4]; - String outputFile = joinPath(this.outputDirectory, className + ".java"); + String outputFile = joinPath(this.expressionOutputDirectory, className + ".java"); //Read the template into a string; - String templateFile = joinPath(this.templateDirectory, tdesc[0] + ".txt"); + String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt"); String templateString = readFile(templateFile); templateString = templateString.replaceAll("", className); templateString = templateString.replaceAll("", inputColumnVectorType); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestCodeGen.java ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/TestCodeGen.java similarity index 91% rename from ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestCodeGen.java rename to ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/TestCodeGen.java index 34c093c..908b8e8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/templates/TestCodeGen.java +++ ql/src/gen/vectorization/org/apache/hadoop/hive/ql/exec/vector/gen/TestCodeGen.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.hive.ql.exec.vector.expressions.templates; +package org.apache.hadoop.hive.ql.exec.vector.gen; import java.io.IOException; import java.util.HashMap; @@ -43,12 +43,12 @@ } private final String testOutputDir; - private final String templateDirectory; + private final String testTemplateDirectory; private final HashMap testsuites; - public TestCodeGen(String testOutputDir, String templateDirectory) { + public TestCodeGen(String testOutputDir, String testTemplateDirectory) { this.testOutputDir = testOutputDir; - this.templateDirectory = templateDirectory; + this.testTemplateDirectory = testTemplateDirectory; testsuites = new HashMap(); for(TestSuiteClassName className : TestSuiteClassName.values()) { @@ -65,7 +65,7 @@ public void addColumnScalarOperationTestCases(boolean op1IsCol, String vectorExp TestSuiteClassName.TestColumnScalarOperationVectorExpressionEvaluation; //Read the template into a string; - String templateFile = CodeGen.joinPath(this.templateDirectory,template.toString()+".txt"); + String templateFile = CodeGen.joinPath(this.testTemplateDirectory,template.toString()+".txt"); String templateString = removeTemplateComments(CodeGen.readFile(templateFile)); for(Boolean[] testMatrix :new Boolean[][]{ @@ -109,7 +109,7 @@ public void addColumnScalarFilterTestCases(boolean op1IsCol, String vectorExpCla TestSuiteClassName.TestColumnScalarFilterVectorExpressionEvaluation; //Read the template into a string; - String templateFile = CodeGen.joinPath(this.templateDirectory,template.toString()+".txt"); + String templateFile = CodeGen.joinPath(this.testTemplateDirectory,template.toString()+".txt"); String templateString = removeTemplateComments(CodeGen.readFile(templateFile)); for(Boolean[] testMatrix : new Boolean[][]{ @@ -132,9 +132,11 @@ public void addColumnScalarFilterTestCases(boolean op1IsCol, String vectorExpCla testCase = testCase.replaceAll("", operatorSymbol); if(op1IsCol){ - testCase = testCase.replaceAll("","0, scalarValue"); + testCase = testCase.replaceAll("","inputColumnVector.vector[i]"); + testCase = testCase.replaceAll("","scalarValue"); }else{ - testCase = testCase.replaceAll("","scalarValue, 0"); + testCase = testCase.replaceAll("","scalarValue"); + testCase = testCase.replaceAll("","inputColumnVector.vector[i]"); } testsuites.get(template).append(testCase); @@ -149,7 +151,7 @@ public void addColumnColumnOperationTestCases(String vectorExpClassName, TestSuiteClassName.TestColumnColumnOperationVectorExpressionEvaluation; //Read the template into a string; - String templateFile = CodeGen.joinPath(this.templateDirectory,template.toString()+".txt"); + String templateFile = CodeGen.joinPath(this.testTemplateDirectory,template.toString()+".txt"); String templateString = removeTemplateComments(CodeGen.readFile(templateFile)); for(Boolean[] testMatrix : new Boolean[][]{ @@ -191,7 +193,7 @@ public void addColumnColumnFilterTestCases(String vectorExpClassName, TestSuiteClassName.TestColumnColumnFilterVectorExpressionEvaluation; //Read the template into a string; - String templateFile = CodeGen.joinPath(this.templateDirectory,template.toString()+".txt"); + String templateFile = CodeGen.joinPath(this.testTemplateDirectory,template.toString()+".txt"); String templateString = removeTemplateComments(CodeGen.readFile(templateFile)); for(Boolean[] testMatrix : new Boolean[][]{ @@ -222,7 +224,7 @@ public void addColumnColumnFilterTestCases(String vectorExpClassName, public void generateTestSuites() throws IOException { - String templateFile = CodeGen.joinPath(this.templateDirectory, "TestClass.txt"); + String templateFile = CodeGen.joinPath(this.testTemplateDirectory, "TestClass.txt"); for(TestSuiteClassName testClass : testsuites.keySet()) { String templateString = CodeGen.readFile(templateFile); diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnColumnOperationVectorExpressionEvaluation.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnColumnOperationVectorExpressionEvaluation.java index dd2cc09..65caba0 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnColumnOperationVectorExpressionEvaluation.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnColumnOperationVectorExpressionEvaluation.java @@ -76,6 +76,7 @@ public void testLongColAddLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -124,6 +125,7 @@ public void testLongColAddLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -172,6 +174,7 @@ public void testLongColAddLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -220,6 +223,7 @@ public void testLongColAddLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -268,6 +272,7 @@ public void testLongColAddLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -316,6 +321,7 @@ public void testLongColAddLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -364,6 +370,7 @@ public void testLongColSubtractLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -412,6 +419,7 @@ public void testLongColSubtractLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -460,6 +468,7 @@ public void testLongColSubtractLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -508,6 +517,7 @@ public void testLongColSubtractLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -556,6 +566,7 @@ public void testLongColSubtractLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -604,6 +615,7 @@ public void testLongColSubtractLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -652,6 +664,7 @@ public void testLongColMultiplyLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -700,6 +713,7 @@ public void testLongColMultiplyLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -748,6 +762,7 @@ public void testLongColMultiplyLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -796,6 +811,7 @@ public void testLongColMultiplyLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -844,6 +860,7 @@ public void testLongColMultiplyLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -892,6 +909,7 @@ public void testLongColMultiplyLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -940,6 +958,7 @@ public void testLongColModuloLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats() "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -988,6 +1007,7 @@ public void testLongColModuloLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1036,6 +1056,7 @@ public void testLongColModuloLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1084,6 +1105,7 @@ public void testLongColModuloLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1132,6 +1154,7 @@ public void testLongColModuloLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1180,6 +1203,7 @@ public void testLongColModuloLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1228,6 +1252,7 @@ public void testLongColAddDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1276,6 +1301,7 @@ public void testLongColAddDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1324,6 +1350,7 @@ public void testLongColAddDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1372,6 +1399,7 @@ public void testLongColAddDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1420,6 +1448,7 @@ public void testLongColAddDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1468,6 +1497,7 @@ public void testLongColAddDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1516,6 +1546,7 @@ public void testLongColSubtractDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1564,6 +1595,7 @@ public void testLongColSubtractDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1612,6 +1644,7 @@ public void testLongColSubtractDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1660,6 +1693,7 @@ public void testLongColSubtractDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1708,6 +1742,7 @@ public void testLongColSubtractDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1756,6 +1791,7 @@ public void testLongColSubtractDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1804,6 +1840,7 @@ public void testLongColMultiplyDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1852,6 +1889,7 @@ public void testLongColMultiplyDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1900,6 +1938,7 @@ public void testLongColMultiplyDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1948,6 +1987,7 @@ public void testLongColMultiplyDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -1996,6 +2036,7 @@ public void testLongColMultiplyDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2044,6 +2085,7 @@ public void testLongColMultiplyDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2092,6 +2134,7 @@ public void testLongColDivideDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2140,6 +2183,7 @@ public void testLongColDivideDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2188,6 +2232,7 @@ public void testLongColDivideDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2236,6 +2281,7 @@ public void testLongColDivideDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2284,6 +2330,7 @@ public void testLongColDivideDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2332,6 +2379,7 @@ public void testLongColDivideDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2380,6 +2428,7 @@ public void testLongColModuloDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2428,6 +2477,7 @@ public void testLongColModuloDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2476,6 +2526,7 @@ public void testLongColModuloDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2524,6 +2575,7 @@ public void testLongColModuloDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2572,6 +2624,7 @@ public void testLongColModuloDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2620,6 +2673,7 @@ public void testLongColModuloDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2668,6 +2722,7 @@ public void testDoubleColAddLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2716,6 +2771,7 @@ public void testDoubleColAddLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2764,6 +2820,7 @@ public void testDoubleColAddLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2812,6 +2869,7 @@ public void testDoubleColAddLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2860,6 +2918,7 @@ public void testDoubleColAddLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2908,6 +2967,7 @@ public void testDoubleColAddLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -2956,6 +3016,7 @@ public void testDoubleColSubtractLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3004,6 +3065,7 @@ public void testDoubleColSubtractLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3052,6 +3114,7 @@ public void testDoubleColSubtractLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3100,6 +3163,7 @@ public void testDoubleColSubtractLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3148,6 +3212,7 @@ public void testDoubleColSubtractLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3196,6 +3261,7 @@ public void testDoubleColSubtractLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3244,6 +3310,7 @@ public void testDoubleColMultiplyLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3292,6 +3359,7 @@ public void testDoubleColMultiplyLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3340,6 +3408,7 @@ public void testDoubleColMultiplyLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3388,6 +3457,7 @@ public void testDoubleColMultiplyLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3436,6 +3506,7 @@ public void testDoubleColMultiplyLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3484,6 +3555,7 @@ public void testDoubleColMultiplyLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3532,6 +3604,7 @@ public void testDoubleColDivideLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3580,6 +3653,7 @@ public void testDoubleColDivideLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3628,6 +3702,7 @@ public void testDoubleColDivideLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3676,6 +3751,7 @@ public void testDoubleColDivideLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3724,6 +3800,7 @@ public void testDoubleColDivideLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3772,6 +3849,7 @@ public void testDoubleColDivideLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3820,6 +3898,7 @@ public void testDoubleColModuloLongColumnOutNullsRepeatsC1RepeatsC2NullsRepeats( "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3868,6 +3947,7 @@ public void testDoubleColModuloLongColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3916,6 +3996,7 @@ public void testDoubleColModuloLongColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -3964,6 +4045,7 @@ public void testDoubleColModuloLongColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4012,6 +4094,7 @@ public void testDoubleColModuloLongColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4060,6 +4143,7 @@ public void testDoubleColModuloLongColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4108,6 +4192,7 @@ public void testDoubleColAddDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeats() "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4156,6 +4241,7 @@ public void testDoubleColAddDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4204,6 +4290,7 @@ public void testDoubleColAddDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4252,6 +4339,7 @@ public void testDoubleColAddDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4300,6 +4388,7 @@ public void testDoubleColAddDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4348,6 +4437,7 @@ public void testDoubleColAddDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4396,6 +4486,7 @@ public void testDoubleColSubtractDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepe "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4444,6 +4535,7 @@ public void testDoubleColSubtractDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4492,6 +4584,7 @@ public void testDoubleColSubtractDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4540,6 +4633,7 @@ public void testDoubleColSubtractDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4588,6 +4682,7 @@ public void testDoubleColSubtractDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4636,6 +4731,7 @@ public void testDoubleColSubtractDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4684,6 +4780,7 @@ public void testDoubleColMultiplyDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepe "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4732,6 +4829,7 @@ public void testDoubleColMultiplyDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4780,6 +4878,7 @@ public void testDoubleColMultiplyDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4828,6 +4927,7 @@ public void testDoubleColMultiplyDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4876,6 +4976,7 @@ public void testDoubleColMultiplyDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4924,6 +5025,7 @@ public void testDoubleColMultiplyDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -4972,6 +5074,7 @@ public void testDoubleColDivideDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5020,6 +5123,7 @@ public void testDoubleColDivideDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5068,6 +5172,7 @@ public void testDoubleColDivideDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5116,6 +5221,7 @@ public void testDoubleColDivideDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5164,6 +5270,7 @@ public void testDoubleColDivideDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5212,6 +5319,7 @@ public void testDoubleColDivideDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5260,6 +5368,7 @@ public void testDoubleColModuloDoubleColumnOutNullsRepeatsC1RepeatsC2NullsRepeat "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5308,6 +5417,7 @@ public void testDoubleColModuloDoubleColumnC1Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5356,6 +5466,7 @@ public void testDoubleColModuloDoubleColumnOutNullsC1NullsC2NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5404,6 +5515,7 @@ public void testDoubleColModuloDoubleColumnOutNullsRepeatsC1NullsRepeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5452,6 +5564,7 @@ public void testDoubleColModuloDoubleColumnC1RepeatsC2Nulls() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector @@ -5500,6 +5613,7 @@ public void testDoubleColModuloDoubleColumnOutRepeatsC2Repeats() { "Output column vector no nulls state does not match operand columns", inputColumnVector1.noNulls && inputColumnVector2.noNulls, outputColumnVector.noNulls); + //if repeating, only the first value matters if(!outputColumnVector.noNulls && !outputColumnVector.isRepeating) { for(int i = 0; i < BATCH_SIZE; i++) { //null vectors are safe to check, as they are always initialized to match the data vector diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnScalarFilterVectorExpressionEvaluation.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnScalarFilterVectorExpressionEvaluation.java index 6baa444..103985e 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnScalarFilterVectorExpressionEvaluation.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/gen/TestColumnScalarFilterVectorExpressionEvaluation.java @@ -60,15 +60,17 @@ public void testFilterLongColEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -121,15 +123,17 @@ public void testFilterLongColEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -182,15 +186,17 @@ public void testFilterLongColEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -243,15 +249,17 @@ public void testFilterLongColEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -304,15 +312,17 @@ public void testFilterDoubleColEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -365,15 +375,17 @@ public void testFilterDoubleColEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -426,15 +438,17 @@ public void testFilterDoubleColEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -487,15 +501,17 @@ public void testFilterDoubleColEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -548,15 +564,17 @@ public void testFilterLongColNotEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -609,15 +627,17 @@ public void testFilterLongColNotEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -670,15 +690,17 @@ public void testFilterLongColNotEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -731,15 +753,17 @@ public void testFilterLongColNotEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -792,15 +816,17 @@ public void testFilterDoubleColNotEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -853,15 +879,17 @@ public void testFilterDoubleColNotEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -914,15 +942,17 @@ public void testFilterDoubleColNotEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -975,15 +1005,17 @@ public void testFilterDoubleColNotEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -1036,15 +1068,17 @@ public void testFilterLongColLessDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1097,15 +1131,17 @@ public void testFilterLongColLessDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1158,15 +1194,17 @@ public void testFilterLongColLessDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1219,15 +1257,17 @@ public void testFilterLongColLessDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1280,15 +1320,17 @@ public void testFilterDoubleColLessDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1341,15 +1383,17 @@ public void testFilterDoubleColLessDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1402,15 +1446,17 @@ public void testFilterDoubleColLessDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1463,15 +1509,17 @@ public void testFilterDoubleColLessDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -1524,15 +1572,17 @@ public void testFilterLongColLessEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1585,15 +1635,17 @@ public void testFilterLongColLessEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1646,15 +1698,17 @@ public void testFilterLongColLessEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1707,15 +1761,17 @@ public void testFilterLongColLessEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1768,15 +1824,17 @@ public void testFilterDoubleColLessEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1829,15 +1887,17 @@ public void testFilterDoubleColLessEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1890,15 +1950,17 @@ public void testFilterDoubleColLessEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -1951,15 +2013,17 @@ public void testFilterDoubleColLessEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -2012,15 +2076,17 @@ public void testFilterLongColGreaterDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2073,15 +2139,17 @@ public void testFilterLongColGreaterDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2134,15 +2202,17 @@ public void testFilterLongColGreaterDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2195,15 +2265,17 @@ public void testFilterLongColGreaterDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2256,15 +2328,17 @@ public void testFilterDoubleColGreaterDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2317,15 +2391,17 @@ public void testFilterDoubleColGreaterDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2378,15 +2454,17 @@ public void testFilterDoubleColGreaterDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2439,15 +2517,17 @@ public void testFilterDoubleColGreaterDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -2500,15 +2580,17 @@ public void testFilterLongColGreaterEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2561,15 +2643,17 @@ public void testFilterLongColGreaterEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2622,15 +2706,17 @@ public void testFilterLongColGreaterEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2683,15 +2769,17 @@ public void testFilterLongColGreaterEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2744,15 +2832,17 @@ public void testFilterDoubleColGreaterEqualDoubleScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2805,15 +2895,17 @@ public void testFilterDoubleColGreaterEqualDoubleScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2866,15 +2958,17 @@ public void testFilterDoubleColGreaterEqualDoubleScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2927,15 +3021,17 @@ public void testFilterDoubleColGreaterEqualDoubleScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -2988,15 +3084,17 @@ public void testFilterLongColEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3049,15 +3147,17 @@ public void testFilterLongColEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3110,15 +3210,17 @@ public void testFilterLongColEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3171,15 +3273,17 @@ public void testFilterLongColEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3232,15 +3336,17 @@ public void testFilterDoubleColEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3293,15 +3399,17 @@ public void testFilterDoubleColEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3354,15 +3462,17 @@ public void testFilterDoubleColEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3415,15 +3525,17 @@ public void testFilterDoubleColEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] == scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] == scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] == scalarValue) { assertEquals( @@ -3476,15 +3588,17 @@ public void testFilterLongColNotEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3537,15 +3651,17 @@ public void testFilterLongColNotEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3598,15 +3714,17 @@ public void testFilterLongColNotEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3659,15 +3777,17 @@ public void testFilterLongColNotEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3720,15 +3840,17 @@ public void testFilterDoubleColNotEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3781,15 +3903,17 @@ public void testFilterDoubleColNotEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3842,15 +3966,17 @@ public void testFilterDoubleColNotEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3903,15 +4029,17 @@ public void testFilterDoubleColNotEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] != scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] != scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] != scalarValue) { assertEquals( @@ -3964,15 +4092,17 @@ public void testFilterLongColLessLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4025,15 +4155,17 @@ public void testFilterLongColLessLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4086,15 +4218,17 @@ public void testFilterLongColLessLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4147,15 +4281,17 @@ public void testFilterLongColLessLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4208,15 +4344,17 @@ public void testFilterDoubleColLessLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4269,15 +4407,17 @@ public void testFilterDoubleColLessLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4330,15 +4470,17 @@ public void testFilterDoubleColLessLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4391,15 +4533,17 @@ public void testFilterDoubleColLessLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] < scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] < scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] < scalarValue) { assertEquals( @@ -4452,15 +4596,17 @@ public void testFilterLongColLessEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4513,15 +4659,17 @@ public void testFilterLongColLessEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4574,15 +4722,17 @@ public void testFilterLongColLessEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4635,15 +4785,17 @@ public void testFilterLongColLessEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4696,15 +4848,17 @@ public void testFilterDoubleColLessEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4757,15 +4911,17 @@ public void testFilterDoubleColLessEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4818,15 +4974,17 @@ public void testFilterDoubleColLessEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4879,15 +5037,17 @@ public void testFilterDoubleColLessEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] <= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] <= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] <= scalarValue) { assertEquals( @@ -4940,15 +5100,17 @@ public void testFilterLongColGreaterLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5001,15 +5163,17 @@ public void testFilterLongColGreaterLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5062,15 +5226,17 @@ public void testFilterLongColGreaterLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5123,15 +5289,17 @@ public void testFilterLongColGreaterLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5184,15 +5352,17 @@ public void testFilterDoubleColGreaterLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5245,15 +5415,17 @@ public void testFilterDoubleColGreaterLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5306,15 +5478,17 @@ public void testFilterDoubleColGreaterLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5367,15 +5541,17 @@ public void testFilterDoubleColGreaterLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] > scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] > scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] > scalarValue) { assertEquals( @@ -5428,15 +5604,17 @@ public void testFilterLongColGreaterEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5489,15 +5667,17 @@ public void testFilterLongColGreaterEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5550,15 +5730,17 @@ public void testFilterLongColGreaterEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5611,15 +5793,17 @@ public void testFilterLongColGreaterEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5672,15 +5856,17 @@ public void testFilterDoubleColGreaterEqualLongScalarColNullsRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5733,15 +5919,17 @@ public void testFilterDoubleColGreaterEqualLongScalarColNulls() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5794,15 +5982,17 @@ public void testFilterDoubleColGreaterEqualLongScalar() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5855,15 +6045,17 @@ public void testFilterDoubleColGreaterEqualLongScalarColRepeats() { vectorExpression.evaluate(rowBatch); + int selectedIndex = 0; + int i=0; //check for isRepeating optimization if(inputColumnVector.isRepeating) { //null vector is safe to check, as it is always initialized to match the data vector selectedIndex = - !inputColumnVector.isNull[0] && inputColumnVector.vector[0] >= scalarValue + !inputColumnVector.isNull[i] && inputColumnVector.vector[i] >= scalarValue ? BATCH_SIZE : 0; } else { - for(int i = 0; i < BATCH_SIZE; i++) { + for(i = 0; i < BATCH_SIZE; i++) { if(!inputColumnVector.isNull[i]) { if(inputColumnVector.vector[i] >= scalarValue) { assertEquals( @@ -5894,6 +6086,6054 @@ public void testFilterDoubleColGreaterEqualLongScalarColRepeats() { } } + @Test + public void testFilterLongScalarEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualDoubleColumn vectorExpression = + new FilterLongScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualDoubleColumn vectorExpression = + new FilterLongScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualDoubleColumn vectorExpression = + new FilterLongScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualDoubleColumn vectorExpression = + new FilterLongScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualDoubleColumn vectorExpression = + new FilterDoubleScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualDoubleColumn vectorExpression = + new FilterDoubleScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualDoubleColumn vectorExpression = + new FilterDoubleScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualDoubleColumn vectorExpression = + new FilterDoubleScalarEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualDoubleColumn vectorExpression = + new FilterLongScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualDoubleColumn vectorExpression = + new FilterLongScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualDoubleColumn vectorExpression = + new FilterLongScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualDoubleColumn vectorExpression = + new FilterLongScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualDoubleColumn vectorExpression = + new FilterDoubleScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualDoubleColumn vectorExpression = + new FilterDoubleScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualDoubleColumn vectorExpression = + new FilterDoubleScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualDoubleColumn vectorExpression = + new FilterDoubleScalarNotEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessDoubleColumn vectorExpression = + new FilterLongScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessDoubleColumn vectorExpression = + new FilterLongScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessDoubleColumn vectorExpression = + new FilterLongScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessDoubleColumn vectorExpression = + new FilterLongScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessDoubleColumn vectorExpression = + new FilterDoubleScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessDoubleColumn vectorExpression = + new FilterDoubleScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessDoubleColumn vectorExpression = + new FilterDoubleScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessDoubleColumn vectorExpression = + new FilterDoubleScalarLessDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualDoubleColumn vectorExpression = + new FilterLongScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualDoubleColumn vectorExpression = + new FilterLongScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualDoubleColumn vectorExpression = + new FilterLongScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualDoubleColumn vectorExpression = + new FilterLongScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualDoubleColumn vectorExpression = + new FilterDoubleScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualDoubleColumn vectorExpression = + new FilterDoubleScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualDoubleColumn vectorExpression = + new FilterDoubleScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualDoubleColumn vectorExpression = + new FilterDoubleScalarLessEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterDoubleColumn vectorExpression = + new FilterLongScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterDoubleColumn vectorExpression = + new FilterLongScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterDoubleColumn vectorExpression = + new FilterLongScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterDoubleColumn vectorExpression = + new FilterLongScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualDoubleColumn vectorExpression = + new FilterLongScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualDoubleColumn vectorExpression = + new FilterLongScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualDoubleColumn vectorExpression = + new FilterLongScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualDoubleColumn vectorExpression = + new FilterLongScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualDoubleColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualDoubleColumnColNulls() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualDoubleColumn() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualDoubleColumnColRepeats() { + + Random rand = new Random(SEED); + + DoubleColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateDoubleColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualDoubleColumn vectorExpression = + new FilterDoubleScalarGreaterEqualDoubleColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualLongColumn vectorExpression = + new FilterLongScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualLongColumn vectorExpression = + new FilterLongScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualLongColumn vectorExpression = + new FilterLongScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarEqualLongColumn vectorExpression = + new FilterLongScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualLongColumn vectorExpression = + new FilterDoubleScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualLongColumn vectorExpression = + new FilterDoubleScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualLongColumn vectorExpression = + new FilterDoubleScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarEqualLongColumn vectorExpression = + new FilterDoubleScalarEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue == inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue == inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "==" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualLongColumn vectorExpression = + new FilterLongScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualLongColumn vectorExpression = + new FilterLongScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualLongColumn vectorExpression = + new FilterLongScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarNotEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarNotEqualLongColumn vectorExpression = + new FilterLongScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualLongColumn vectorExpression = + new FilterDoubleScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualLongColumn vectorExpression = + new FilterDoubleScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualLongColumn vectorExpression = + new FilterDoubleScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarNotEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarNotEqualLongColumn vectorExpression = + new FilterDoubleScalarNotEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue != inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue != inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "!=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessLongColumn vectorExpression = + new FilterLongScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessLongColumn vectorExpression = + new FilterLongScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessLongColumn vectorExpression = + new FilterLongScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessLongColumn vectorExpression = + new FilterLongScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessLongColumn vectorExpression = + new FilterDoubleScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessLongColumn vectorExpression = + new FilterDoubleScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessLongColumn vectorExpression = + new FilterDoubleScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessLongColumn vectorExpression = + new FilterDoubleScalarLessLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue < inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue < inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualLongColumn vectorExpression = + new FilterLongScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualLongColumn vectorExpression = + new FilterLongScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualLongColumn vectorExpression = + new FilterLongScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarLessEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarLessEqualLongColumn vectorExpression = + new FilterLongScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualLongColumn vectorExpression = + new FilterDoubleScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualLongColumn vectorExpression = + new FilterDoubleScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualLongColumn vectorExpression = + new FilterDoubleScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarLessEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarLessEqualLongColumn vectorExpression = + new FilterDoubleScalarLessEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue <= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue <= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + "<=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterLongColumn vectorExpression = + new FilterLongScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterLongColumn vectorExpression = + new FilterLongScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterLongColumn vectorExpression = + new FilterLongScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterLongColumn vectorExpression = + new FilterLongScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterLongColumn vectorExpression = + new FilterDoubleScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterLongColumn vectorExpression = + new FilterDoubleScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterLongColumn vectorExpression = + new FilterDoubleScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterLongColumn vectorExpression = + new FilterDoubleScalarGreaterLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue > inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue > inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualLongColumn vectorExpression = + new FilterLongScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualLongColumn vectorExpression = + new FilterLongScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualLongColumn vectorExpression = + new FilterLongScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterLongScalarGreaterEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + long scalarValue = 0; + do { + scalarValue = rand.nextLong(); + } while(scalarValue == 0); + + FilterLongScalarGreaterEqualLongColumn vectorExpression = + new FilterLongScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualLongColumnColNullsRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualLongColumn vectorExpression = + new FilterDoubleScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualLongColumnColNulls() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(true, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualLongColumn vectorExpression = + new FilterDoubleScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualLongColumn() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + false, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualLongColumn vectorExpression = + new FilterDoubleScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + + @Test + public void testFilterDoubleScalarGreaterEqualLongColumnColRepeats() { + + Random rand = new Random(SEED); + + LongColumnVector inputColumnVector = + VectorizedRowGroupGenUtil.generateLongColumnVector(false, + true, BATCH_SIZE, rand); + + VectorizedRowBatch rowBatch = new VectorizedRowBatch(1, BATCH_SIZE); + rowBatch.cols[0] = inputColumnVector; + + double scalarValue = 0; + do { + scalarValue = rand.nextDouble(); + } while(scalarValue == 0); + + FilterDoubleScalarGreaterEqualLongColumn vectorExpression = + new FilterDoubleScalarGreaterEqualLongColumn(0, scalarValue); + + vectorExpression.evaluate(rowBatch); + + + int selectedIndex = 0; + int i=0; + //check for isRepeating optimization + if(inputColumnVector.isRepeating) { + //null vector is safe to check, as it is always initialized to match the data vector + selectedIndex = + !inputColumnVector.isNull[i] && scalarValue >= inputColumnVector.vector[i] + ? BATCH_SIZE : 0; + } else { + for(i = 0; i < BATCH_SIZE; i++) { + if(!inputColumnVector.isNull[i]) { + if(scalarValue >= inputColumnVector.vector[i]) { + assertEquals( + "Vector index that passes filter " + + scalarValue + ">=" + + inputColumnVector.vector[i] + " is not in rowBatch selected index", + i, + rowBatch.selected[selectedIndex]); + selectedIndex++; + } + } + } + } + + assertEquals("Row batch size not set to number of selected rows: " + selectedIndex, + selectedIndex, rowBatch.size); + + if(selectedIndex > 0 && selectedIndex < BATCH_SIZE) { + assertEquals( + "selectedInUse should be set when > 0 and < entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + true, rowBatch.selectedInUse); + } else if(selectedIndex == BATCH_SIZE) { + assertEquals( + "selectedInUse should not be set when entire batch(" + BATCH_SIZE + ") is selected: " + + selectedIndex, + false, rowBatch.selectedInUse); + } + } + } -- 1.8.0.msysgit.0