use of org.apache.drill.common.expression.TypedNullConstant in project drill by apache.
the class TestSimpleFunctions method testHashFunctionResolution.
@Test
public void testHashFunctionResolution() throws JClassAlreadyExistsException, IOException {
final FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
// test required vs nullable Int input
resolveHash(new TypedNullConstant(Types.optional(TypeProtos.MinorType.INT)), TypeProtos.DataMode.OPTIONAL, registry);
resolveHash(new ValueExpressions.IntExpression(1, ExpressionPosition.UNKNOWN), TypeProtos.DataMode.REQUIRED, registry);
// test required vs nullable float input
resolveHash(new TypedNullConstant(Types.optional(TypeProtos.MinorType.FLOAT4)), TypeProtos.DataMode.OPTIONAL, registry);
resolveHash(new ValueExpressions.FloatExpression(5.0f, ExpressionPosition.UNKNOWN), TypeProtos.DataMode.REQUIRED, registry);
// test required vs nullable long input
resolveHash(new TypedNullConstant(Types.optional(TypeProtos.MinorType.BIGINT)), TypeProtos.DataMode.OPTIONAL, registry);
resolveHash(new ValueExpressions.LongExpression(100L, ExpressionPosition.UNKNOWN), TypeProtos.DataMode.REQUIRED, registry);
// test required vs nullable double input
resolveHash(new TypedNullConstant(Types.optional(TypeProtos.MinorType.FLOAT8)), TypeProtos.DataMode.OPTIONAL, registry);
resolveHash(new ValueExpressions.DoubleExpression(100.0, ExpressionPosition.UNKNOWN), TypeProtos.DataMode.REQUIRED, registry);
}
Aggregations