Interface PostOptimizationVerificationAware

All Known Implementing Classes:
Bucket, FoldablesConvertFunction, Match, MatchOperator, MvSort, OrderBy, Term, ToDatePeriod, ToTimeDuration

public interface PostOptimizationVerificationAware
Interface implemented by expressions that require validation post logical optimization, when the plan and references have been not just resolved but also replaced.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Validates the implementing expression - discovered failures are reported to the given Failures class.
  • Method Details

    • postOptimizationVerification

      void postOptimizationVerification(Failures failures)
      Validates the implementing expression - discovered failures are reported to the given Failures class.

      Example: the Bucket function, which produces buckets over a numerical or date field, based on a number of literal arguments needs to check if its arguments are all indeed literals. This is how this verification is performed:

           
      
            @Override
            public void postOptimizationVerification(Failures failures) {
                String operation = sourceText();
      
                failures.add(isFoldable(buckets, operation, SECOND))
                    .add(from != null ? isFoldable(from, operation, THIRD) : null)
                    .add(to != null ? isFoldable(to, operation, FOURTH) : null);
            }