Class RexChecker

org.apache.calcite.rex.RexVisitorImpl<@Nullable Boolean>
All Implemented Interfaces:

public class RexChecker extends RexVisitorImpl<@Nullable Boolean>
Visitor which checks the validity of a RexNode expression.

There are two modes of operation:

  • Usefail=true to throw an AssertionError as soon as an invalid node is detected:
    RexNode node;
    RelDataType rowType;
    assert new RexChecker(rowType, true).isValid(node);

    This mode requires that assertions are enabled.

  • Use fail=false to test for validity without throwing an error.
    RexNode node;
    RelDataType rowType;
    RexChecker checker = new RexChecker(rowType, false);
    if (!checker.valid) {
See Also: