Search in sources :

Example 6 with VarCharHolder

use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.

the class TestByteComparisonFunctions method testBeforeLong.

@Test
public void testBeforeLong() {
    final VarCharHolder left = goodbyeLong;
    final VarCharHolder right = helloLong;
    assertTrue(ByteFunctionHelpers.compare(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == -1);
}
Also used : VarCharHolder(org.apache.drill.exec.expr.holders.VarCharHolder) Test(org.junit.Test) ExecTest(org.apache.drill.exec.ExecTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) VectorTest(org.apache.drill.categories.VectorTest)

Example 7 with VarCharHolder

use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.

the class TestByteComparisonFunctions method testEqualLong.

@Test
public void testEqualLong() {
    final VarCharHolder left = helloLong;
    final VarCharHolder right = helloLong;
    assertTrue(ByteFunctionHelpers.equal(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == 1);
}
Also used : VarCharHolder(org.apache.drill.exec.expr.holders.VarCharHolder) Test(org.junit.Test) ExecTest(org.apache.drill.exec.ExecTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) VectorTest(org.apache.drill.categories.VectorTest)

Example 8 with VarCharHolder

use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.

the class TestByteComparisonFunctions method testAfter.

@Test
public void testAfter() {
    final VarCharHolder left = hello;
    final VarCharHolder right = goodbye;
    assertTrue(ByteFunctionHelpers.compare(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == 1);
}
Also used : VarCharHolder(org.apache.drill.exec.expr.holders.VarCharHolder) Test(org.junit.Test) ExecTest(org.apache.drill.exec.ExecTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) VectorTest(org.apache.drill.categories.VectorTest)

Example 9 with VarCharHolder

use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.

the class TestByteComparisonFunctions method testBefore.

@Test
public void testBefore() {
    final VarCharHolder left = goodbye;
    final VarCharHolder right = hello;
    assertTrue(ByteFunctionHelpers.compare(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == -1);
}
Also used : VarCharHolder(org.apache.drill.exec.expr.holders.VarCharHolder) Test(org.junit.Test) ExecTest(org.apache.drill.exec.ExecTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) VectorTest(org.apache.drill.categories.VectorTest)

Example 10 with VarCharHolder

use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.

the class TestByteComparisonFunctions method testAfterLong.

@Test
public void testAfterLong() {
    final VarCharHolder left = helloLong;
    final VarCharHolder right = goodbyeLong;
    assertTrue(ByteFunctionHelpers.compare(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == 1);
}
Also used : VarCharHolder(org.apache.drill.exec.expr.holders.VarCharHolder) Test(org.junit.Test) ExecTest(org.apache.drill.exec.ExecTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) VectorTest(org.apache.drill.categories.VectorTest)

Aggregations

VarCharHolder (org.apache.drill.exec.expr.holders.VarCharHolder)36 Test (org.junit.Test)23 UnlikelyTest (org.apache.drill.categories.UnlikelyTest)20 VectorTest (org.apache.drill.categories.VectorTest)20 ExecTest (org.apache.drill.exec.ExecTest)20 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)5 FunctionImplementationRegistry (org.apache.drill.exec.expr.fn.FunctionImplementationRegistry)4 FieldReader (org.apache.drill.exec.vector.complex.reader.FieldReader)4 BaseWriter (org.apache.drill.exec.vector.complex.writer.BaseWriter)4 SchemaPath (org.apache.drill.common.expression.SchemaPath)3 PhysicalPlan (org.apache.drill.exec.physical.PhysicalPlan)3 FragmentRoot (org.apache.drill.exec.physical.base.FragmentRoot)3 PhysicalPlanReader (org.apache.drill.exec.planner.PhysicalPlanReader)3 VarCharVector (org.apache.drill.exec.vector.VarCharVector)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 BitHolder (org.apache.drill.exec.expr.holders.BitHolder)2 VarDecimalHolder (org.apache.drill.exec.expr.holders.VarDecimalHolder)2 DrillBuf (io.netty.buffer.DrillBuf)1 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1