Search in sources :

Example 1 with IntegerNumberToVarcharCoercer

use of com.facebook.presto.hive.HiveCoercer.IntegerNumberToVarcharCoercer in project presto by prestodb.

the class TestCoercingFilters method testIntegerToVarchar.

@Test
public void testIntegerToVarchar() {
    TupleDomainFilter filter = BytesRange.of("10".getBytes(), false, "10".getBytes(), false, false);
    HiveCoercer coercer = new IntegerNumberToVarcharCoercer(INTEGER, VARCHAR);
    TupleDomainFilter coercingFilter = coercer.toCoercingFilter(filter, new Subfield("c"));
    assertTrue(coercingFilter.testLong(10));
    assertFalse(coercingFilter.testLong(25));
    assertFalse(coercingFilter.testNull());
}
Also used : IntegerNumberToVarcharCoercer(com.facebook.presto.hive.HiveCoercer.IntegerNumberToVarcharCoercer) Subfield(com.facebook.presto.common.Subfield) TupleDomainFilter(com.facebook.presto.common.predicate.TupleDomainFilter) Test(org.testng.annotations.Test)

Aggregations

Subfield (com.facebook.presto.common.Subfield)1 TupleDomainFilter (com.facebook.presto.common.predicate.TupleDomainFilter)1 IntegerNumberToVarcharCoercer (com.facebook.presto.hive.HiveCoercer.IntegerNumberToVarcharCoercer)1 Test (org.testng.annotations.Test)1