@Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    FieldNode fieldNode = (FieldNode) o;

    if (fieldName != null ? !fieldName.equals(fieldNode.fieldName) : fieldNode.fieldName != null) {
      return false;
    }
    return nodes != null ? nodes.equals(fieldNode.nodes) : fieldNode.nodes == null;

  }
Merge the field nodes 'left' and 'right' and return the merged node.
Return null if the two nodes cannot be merged.

There are basically 3 cases here:
1. 'left' and 'right' have the same depth, e.g., 'left' is s[b[c]] and
  'right' is s[b[d]]. In this case, the merged node is s[b[c,d]]
2. 'left' has larger depth than 'right', e.g., 'left' is s[b] while
  'right' is s[b[d]]. In this case, the merged node is s[b]
3. 'left' has smaller depth than 'right', e.g., 'left' is s[b[c]] while
  'right' is s[b]. This is the opposite case of 2), and similarly,
  the merged node is s[b].

A example where the two inputs cannot be merged is, 'left' is s[b] while
  'right' is p[c].
ql/src/java/org/apache/hadoop/hive/ql/optimizer/FieldNode.java