Skip to content

Commit

Permalink
Merge pull request apache#344 from szehon/master
Browse files Browse the repository at this point in the history
select * from parquet hive table containing map columns runs into exception. Issue apache#341.
  • Loading branch information
julienledem committed Apr 4, 2014
2 parents f5edd0a + 253eb6a commit 3f5de76
Showing 1 changed file with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,31 +133,43 @@ public Object clear(Object map) {
return m;
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((keyInspector == null) ? 0 : keyInspector.hashCode());
result = prime * result
+ ((valueInspector == null) ? 0 : valueInspector.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;
}
final StandardParquetHiveMapInspector other = (StandardParquetHiveMapInspector) obj;
if (this.keyInspector != other.keyInspector &&
(this.keyInspector == null || !this.keyInspector.equals(other.keyInspector))) {
final AbstractParquetMapInspector other = (AbstractParquetMapInspector) obj;
if (keyInspector == null) {
if (other.keyInspector != null) {
return false;
}
} else if (!keyInspector.equals(other.keyInspector)) {
return false;
}
if (this.valueInspector != other.valueInspector &&
(this.valueInspector == null || !this.valueInspector.equals(other.valueInspector))) {
if (valueInspector == null) {
if (other.valueInspector != null) {
return false;
}
} else if (!valueInspector.equals(other.valueInspector)) {
return false;
}
return true;
}

@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + (this.keyInspector != null ? this.keyInspector.hashCode() : 0);
hash = 59 * hash + (this.valueInspector != null ? this.valueInspector.hashCode() : 0);
return hash;
}
}

0 comments on commit 3f5de76

Please sign in to comment.