public static long expressionToTimestamp(Expression expression, ZoneId zoneId) {
    long timestamp;
    if (expression instanceof LongLiteral) {
      timestamp = ((LongLiteral) expression).getParsedValue();
    } else if (expression instanceof NullLiteral) {
      throw new SemanticException("Timestamp cannot be null");
    } else if (expression instanceof StringLiteral) {
      timestamp =
          parseDateTimeFormat(
              ((StringLiteral) expression).getValue(), CommonDateTimeUtils.currentTime(), zoneId);
    } else {
      throw new SemanticException("Unsupported expression: " + expression);
    }
    return timestamp;
  }
Computes a hash of the given AST by applying the provided subtree hasher at each level.

<p>If the hasher returns a non-empty {@link OptionalInt}, the value is treated as the hash for
the subtree at that node. Otherwise, the hashes of its children are computed and combined.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/util/AstUtil.java