use of com.facebook.presto.spi.function.SqlFunction in project presto by prestodb.
the class TestFunctionAndTypeManager method testExactMatchBeforeCoercion.
@Test
public void testExactMatchBeforeCoercion() {
FunctionAndTypeManager functionAndTypeManager = createTestFunctionAndTypeManager();
boolean foundOperator = false;
for (SqlFunction function : functionAndTypeManager.listOperators()) {
OperatorType operatorType = tryGetOperatorType(function.getSignature().getName()).get();
if (operatorType == CAST || operatorType == SATURATED_FLOOR_CAST) {
continue;
}
if (!function.getSignature().getTypeVariableConstraints().isEmpty()) {
continue;
}
if (function.getSignature().getArgumentTypes().stream().anyMatch(TypeSignature::isCalculated)) {
continue;
}
BuiltInFunctionHandle exactOperator = (BuiltInFunctionHandle) functionAndTypeManager.resolveOperator(operatorType, fromTypeSignatures(function.getSignature().getArgumentTypes()));
assertEquals(exactOperator.getSignature(), function.getSignature());
foundOperator = true;
}
assertTrue(foundOperator);
}
Aggregations