public Predicate convert(List<ScalarOperator> operators, DeltaLakeContext context) {
        DeltaLakeExprVisitor visitor = new DeltaLakeExprVisitor();
        List<Predicate> predicates = Lists.newArrayList();

        for (ScalarOperator operator : operators) {
            Predicate predicate = operator.accept(visitor, context);
            if (predicate != null) {
                predicates.add(predicate);
            }
        }

        Optional<Predicate> result = predicates.stream().reduce(And::new);
        return result.orElse(ALWAYS_TRUE);
    }
@Test
    public void testConvertCompoundPredicate() {
        ScalarOperationToDeltaLakeExpr converter = new ScalarOperationToDeltaLakeExpr();
        ScalarOperationToDeltaLakeExpr.DeltaLakeContext context =
                new ScalarOperationToDeltaLakeExpr.DeltaLakeContext(schema, new HashSet<>());
        ConstantOperator value1 = ConstantOperator.createInt(5);
        ConstantOperator value2 = ConstantOperator.createInt(10);
        Literal literal1 = Literal.ofInt(5);
        Literal literal2 = Literal.ofInt(10);
        List<ScalarOperator> operators;

        // and
        ScalarOperator gtOperator = new BinaryPredicateOperator(BinaryType.GT, cIntCol, value1);
        ScalarOperator ltOperator = new BinaryPredicateOperator(BinaryType.LT, cIntCol, value2);
        CompoundPredicateOperator operator = new CompoundPredicateOperator(CompoundPredicateOperator.CompoundType.AND,
                gtOperator, ltOperator);
        operators = new ArrayList<>(List.of(operator));
        Predicate convertExpr = converter.convert(operators, context);
        Predicate expectedExpr = new And(new Predicate(">", cDeltaIntCol, literal1),
                new Predicate("<", cDeltaIntCol, literal2));
        Assert.assertEquals(convertExpr.toString(), expectedExpr.toString());

        // or
        ltOperator = new BinaryPredicateOperator(BinaryType.LT, cIntCol, value1);
        gtOperator = new BinaryPredicateOperator(BinaryType.GT, cIntCol, value2);
        operator = new CompoundPredicateOperator(CompoundPredicateOperator.CompoundType.OR, ltOperator, gtOperator);
        operators = new ArrayList<>(List.of(operator));
        convertExpr = converter.convert(operators, context);
        expectedExpr = new Or(new Predicate("<", cDeltaIntCol, literal1), new Predicate(">", cDeltaIntCol, literal2));
        Assert.assertEquals(convertExpr.toString(), expectedExpr.toString());

        // NOT
        ltOperator = new BinaryPredicateOperator(BinaryType.LT, cIntCol, value1);
        operator = new CompoundPredicateOperator(CompoundPredicateOperator.CompoundType.NOT, ltOperator);
        operators = new ArrayList<>(List.of(operator));
        convertExpr = converter.convert(operators, context);
        expectedExpr = new Predicate("NOT", new Predicate("<", cDeltaIntCol, literal1));
        Assert.assertEquals(convertExpr.toString(), expectedExpr.toString());
    }