public static Object expressionToTsValue(Expression expression) {
    if (expression instanceof Literal) {
      return ((Literal) expression).getTsValue();
    }
    if (expression instanceof Identifier) {
      throw new SemanticException(
          String.format("Cannot insert identifier %s, please use string literal", expression));
    }
    throw new SemanticException("Unsupported expression: " + expression);
  }
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