private TreeNode buildTreeFromNodes(List<? extends TreeNode> nodes, LogicalOperator operator) {
    // The 'nodes' list is expected to have at least one element.
    // If the list if empty, the lexer parse would have failed.
    if (nodes.size() == 1) {
      return nodes.get(0);
    }
    TreeNode root = new TreeNode(nodes.get(0), operator, nodes.get(1));
    for (int i = 2; i < nodes.size(); ++i) {
      TreeNode tmp = new TreeNode(root, operator, nodes.get(i));
      root = tmp;
    }
    return root;
  }
Override the default behavior for all visit methods. This will only return a non-null result
when the context has only one child. This is done because there is no generic method to
combine the results of the context children. In all other cases null is returned.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/PartFilterVisitor.java