Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/34#discussion_r23674358 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/parse/LiteralParseNode.java --- @@ -80,4 +80,35 @@ public boolean isStateless() { public String toString() { return type == PVarchar.INSTANCE ? ("'" + value.toString() + "'") : value == null ? "null" : value.toString(); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((type == null) ? 0 : type.hashCode()); + result = prime * result + ((value == null) ? 0 : value.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; + LiteralParseNode other = (LiteralParseNode) obj; + if (type == null) { --- End diff -- Instead of comparing type and value for equals, do this: return type.isComparableTo(other.type) && type.compareTo(value, other.value, other.type) == 0; This will ensure that a CHAR type of 'AAA' will equal a VARCHAR type of 'AAA' and a DECIMAL type with a value of 5.0 will equal an INTEGER type with a value of 5.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---