@Override
      public Void visitCall(org.apache.calcite.rex.RexCall call) {
        // non-deterministic functions as well as runtime constants are not materializable.
        SqlOperator op = call.getOperator();
        if (!op.isDeterministic() || op.isDynamicFunction() ||
            (op instanceof HiveSqlFunction && ((HiveSqlFunction) op).isRuntimeConstant())) {
          throw new Util.FoundOne(call);
        }
        return super.visitCall(call);
      }
Check if the expression is usable for query materialization, returning the first failing expression.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java