[ 
https://issues.apache.org/jira/browse/PHOENIX-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14294921#comment-14294921
 ] 

ASF GitHub Bot commented on PHOENIX-514:
----------------------------------------

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.


> Support functional indexes
> --------------------------
>
>                 Key: PHOENIX-514
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-514
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Thomas D'Silva
>              Labels: enhancement
>
> Instead of only defining the set of columns from the data table that make up 
> an index, you should be able to use expressions.  For example:
>       CREATE INDEX upper_last_name_idx ON person (UPPER(last_name))
> Then in queries that use UPPER(last_name), we can replace them with column 
> references to the index table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to