public void unsupportedByCalciteRewrite(String sqlPartType, String sqlPart) {
    if (isValidForAutomaticRewriting()) {
      String errorMessage = String.format(UNSUPPORTED_BY_CALCITE_FORMAT, sqlPartType, sqlPart);
      this.materializationValidationResult =
          new MaterializationValidationResult(EnumSet.of(TEXT), errorMessage);
    }
  }
Checks the query plan for conditions that would make the plan unsuitable for
materialized views or query caching:
- References to temporary or external tables
- References to non-deterministic functions.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptMaterializationValidator.java