Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2319#discussion_r189549116
--- Diff:
core/src/main/java/org/apache/carbondata/core/metadata/datatype/StructField.java
---
@@ -54,4 +54,41 @@ public String getFieldName() {
public List<StructField> getChildren() {
return children;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result +
+ fieldName.hashCode() + dataType.hashCode() + ((children == null) ?
0 : children.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ StructField other = (StructField) obj;
+ if (!this.fieldName.equalsIgnoreCase(other.fieldName)) {
+ return false;
+ }
+ if (!this.dataType.equals(other.dataType)) {
+ return false;
+ }
+ if (children == null) {
+ if (other.children != null) {
+ return false;
+ }
+ } else if (!children.equals(other.children)) {
--- End diff --
children != null && other.children == null will through exception
---