private Optional<Signature> getSaturatedFloorCastOperator(Type fromType, Type toType) { if (metadata.getFunctionRegistry().canResolveOperator(SATURATED_FLOOR_CAST, toType, ImmutableList.of(fromType))) { return Optional.of(internalOperator(SATURATED_FLOOR_CAST, toType, ImmutableList.of(fromType))); } return Optional.empty(); }
for (Type type : typeManager.getTypes()) { if (type.isComparable()) { if (!functions.canResolveOperator(HASH_CODE, BIGINT, ImmutableList.of(type))) { missingOperators.put(type, HASH_CODE); if (!functions.canResolveOperator(EQUAL, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, EQUAL); if (!functions.canResolveOperator(NOT_EQUAL, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, NOT_EQUAL); if (!functions.canResolveOperator(operator, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, operator); if (!functions.canResolveOperator(BETWEEN, BOOLEAN, ImmutableList.of(type, type, type))) { missingOperators.put(type, BETWEEN);
@Test public void testCastOperatorsExistForCoercions() { Set<Type> types = getStandardPrimitiveTypes(); for (Type sourceType : types) { for (Type resultType : types) { if (typeRegistry.canCoerce(sourceType, resultType) && sourceType != UNKNOWN && resultType != UNKNOWN) { assertTrue(functionRegistry.canResolveOperator(OperatorType.CAST, resultType, ImmutableList.of(sourceType)), format("'%s' -> '%s' coercion exists but there is no cast operator", sourceType, resultType)); } } } }
for (Type type : typeManager.getTypes()) { if (type.isComparable()) { if (!functions.canResolveOperator(HASH_CODE, BIGINT, ImmutableList.of(type))) { missingOperators.put(type, HASH_CODE); if (!functions.canResolveOperator(EQUAL, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, EQUAL); if (!functions.canResolveOperator(NOT_EQUAL, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, NOT_EQUAL); if (!functions.canResolveOperator(operator, BOOLEAN, ImmutableList.of(type, type))) { missingOperators.put(type, operator); if (!functions.canResolveOperator(BETWEEN, BOOLEAN, ImmutableList.of(type, type, type))) { missingOperators.put(type, BETWEEN);