presto-main/src/main/java/io/prestosql/metadata/MetadataManager.java/MetadataManager/verifyComparableOrderableContract
class MetadataManager:    @Override
    public void verifyComparableOrderableContract()
    {
        Multimap<Type, OperatorType> missingOperators = HashMultimap.create();
        for (Type type : typeRegistry.getTypes()) {
            if (type.isComparable()) {
                for (OperatorType operator : ImmutableList.of(HASH_CODE, XX_HASH_64)) {
                    if (!functions.canResolveOperator(operator, BIGINT, ImmutableList.of(type))) {
                        missingOperators.put(type, operator);
                    }
                }
                for (OperatorType operator : ImmutableList.of(INDETERMINATE)) {
                    if (!functions.canResolveOperator(operator, BOOLEAN, ImmutableList.of(type))) {
                        missingOperators.put(type, operator);
                    }
                }
                for (OperatorType operator : ImmutableList.of(EQUAL, NOT_EQUAL, IS_DISTINCT_FROM)) {
                    if (!functions.canResolveOperator(operator, BOOLEAN, ImmutableList.of(type, type))) {
                        missingOperators.put(type, operator);
                    }
                }
            }
            if (type.isOrderable()) {
                for (OperatorType operator : ImmutableList.of(LESS_THAN, LESS_THAN_OR_EQUAL, GREATER_THAN, GREATER_THAN_OR_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);
                }
            }
        }
        // TODO: verify the parametric types too
        if (!missingOperators.isEmpty()) {
            List<String> messages = new ArrayList<>();
            for (Type type : missingOperators.keySet()) {
                messages.add(format("%s missing for %s", missingOperators.get(type), type));
            }
            throw new IllegalStateException(Joiner.on(", ").join(messages));
        }
    }