public static RowExpression rewrite(RowExpression expression, VariableAllocator variableAllocator)
    {
        return RowExpressionTreeRewriter.rewriteWith(new Visitor(variableAllocator), expression, new Context());
    }
@Test
    public void testRewriteBasicLambda()
    {
        RowExpression inputExpression = testSqlToRowExpressionTranslator.translate("any_match(ARRAY[], x -> x = a)", ImmutableMap.of("a", BIGINT));
        CallExpression rewritten = (CallExpression) LambdaCaptureDesugaringRowExpressionRewriter.rewrite(inputExpression, new VariableAllocator(ImmutableList.of(new VariableReferenceExpression(Optional.empty(), "a", BIGINT))));
        assertTrue(rewritten.getArguments().get(1) instanceof SpecialFormExpression);
        SpecialFormExpression bind = (SpecialFormExpression) rewritten.getArguments().get(1);
        assertEquals(bind.toString(), "BIND(a, (a_0,x) -> EQUAL(x, a_0))");
    }