use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by axbaretto.
the class ValueHolderHelper method getVarCharHolder.
public static VarCharHolder getVarCharHolder(DrillBuf buf, String s) {
VarCharHolder vch = new VarCharHolder();
byte[] b = s.getBytes(Charsets.UTF_8);
vch.start = 0;
vch.end = b.length;
vch.buffer = buf.reallocIfNeeded(b.length);
vch.buffer.setBytes(0, b);
return vch;
}
use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by apache.
the class ValueHolderHelper method getVarCharHolder.
public static VarCharHolder getVarCharHolder(DrillBuf buf, String s) {
VarCharHolder vch = new VarCharHolder();
byte[] b = s.getBytes(Charsets.UTF_8);
vch.start = 0;
vch.end = b.length;
vch.buffer = buf.reallocIfNeeded(b.length);
vch.buffer.setBytes(0, b);
return vch;
}
use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by apache.
the class TestByteComparisonFunctions method testEqual.
@Test
public void testEqual() {
final VarCharHolder left = hello;
final VarCharHolder right = hello;
assertTrue(ByteFunctionHelpers.equal(left.buffer, left.start, left.end, right.buffer, right.start, right.end) == 1);
}
use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by apache.
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);
}
use of org.apache.drill.exec.expr.holders.VarCharHolder in project drill by apache.
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);
}
Aggregations