public boolean isConsistentWithinQuery() {
    return (isDeterministic() || isRuntimeConstant()) && !isStateful();
  }
Returns whether the expression, for a single query, returns the same result given
the same arguments. This includes deterministic functions as well as runtime
constants (which may not be deterministic across queries).
ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeEvaluator.java