Class SqlValidatorImpl.NavigationReplacer

  • All Implemented Interfaces:
    Enclosing class:

    private static class SqlValidatorImpl.NavigationReplacer
    extends SqlValidatorImpl.NavigationModifier
    Shuttle that replaces A as A.price > PREV(B.price) with PREV(A.price, 0) > LAST(B.price, 0).

    Replacing A.price with PREV(A.price, 0) makes the implementation of RexVisitor.visitPatternFieldRef(RexPatternFieldRef) more unified. Otherwise, it's difficult to implement this method. If it returns the specified field, then the navigation such as PREV(A.price, 1) becomes impossible; if not, then comparisons such as A.price > PREV(A.price, 1) become meaningless.