public static boolean isEffectivelyLiteral(
      Expression expression, PlannerContext plannerContext, SessionInfo session) {
    if (expression instanceof Literal) {
      return true;
    }
    if (expression instanceof Cast) {
      return ((Cast) expression).getExpression() instanceof Literal
          // a Cast(Literal(...)) can fail, so this requires verification
          && constantExpressionEvaluatesSuccessfully(plannerContext, session, expression);
    }

    if (expression instanceof FunctionCall) {
      String functionName = ((FunctionCall) expression).getName().getSuffix();
      if (functionName.equals("pi") || functionName.equals("e")) {
        return true;
      }
    }

    return false;
  }
Returns whether expression is effectively literal. An effectively literal expression is a
simple constant value, or null, in either {@link Literal} form, or other form returned by
LiteralEncoder. In particular, other constant expressions like a deterministic function call
with constant arguments are not considered effectively literal.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/IrUtils.java