@Override
    public Supplier<Predicate> compilePredicate(SqlFunctionProperties sqlFunctionProperties, Map<SqlFunctionId, SqlInvokedFunction> sessionFunctions, RowExpression predicate)
    {
        if (predicateCache == null) {
            return compilePredicateInternal(sqlFunctionProperties, sessionFunctions, predicate);
        }
        return predicateCache.getUnchecked(new CacheKey(sqlFunctionProperties, sessionFunctions, predicate));
    }
@Test
    public void testCache()
    {
        // a * 2 < 10
        RowExpression predicate = call(
                "=",
                functionResolution.comparisonFunction(LESS_THAN, BIGINT, BIGINT),
                BOOLEAN,
                call("a * 2", functionResolution.arithmeticFunction(MULTIPLY, BIGINT, BIGINT), BIGINT, new InputReferenceExpression(Optional.empty(), 1, BIGINT), constant(2L, BIGINT)),
                constant(10L, BIGINT));

        PredicateCompiler compiler = new RowExpressionPredicateCompiler(metadata, 10_000);
        assertSame(
                compiler.compilePredicate(SESSION.getSqlFunctionProperties(), SESSION.getSessionFunctions(), predicate),
                compiler.compilePredicate(SESSION.getSqlFunctionProperties(), SESSION.getSessionFunctions(), predicate));

        PredicateCompiler noCacheCompiler = new RowExpressionPredicateCompiler(metadata, 0);
        assertNotSame(
                noCacheCompiler.compilePredicate(SESSION.getSqlFunctionProperties(), SESSION.getSessionFunctions(), predicate),
                noCacheCompiler.compilePredicate(SESSION.getSqlFunctionProperties(), SESSION.getSessionFunctions(), predicate));
    }