hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Koifman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-14542) VirtualColumn::equals() should use object equality
Date Wed, 31 Aug 2016 23:21:20 GMT

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

Eugene Koifman commented on HIVE-14542:
---------------------------------------

[~gopalv] 
Since VirtualColumn is immutable and all c'tors are final, each instance is a singleton. 
wouldn't

public boolean equals(Object o) {
    return this == o;
}

work?  

> VirtualColumn::equals() should use object equality
> --------------------------------------------------
>
>                 Key: HIVE-14542
>                 URL: https://issues.apache.org/jira/browse/HIVE-14542
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Gopal V
>            Priority: Minor
>         Attachments: virtual-columns.png
>
>
> The VirtualColumn() constructor is private and is only called to initialize 5 static
objects.
> !virtual-columns.png!
> There's no reason for VirtualColumn::equals() to do a deep type inspection for each access
of a complex type like ROW__ID.
> {code}
>   else if(vc.equals(VirtualColumn.ROWID)) {
>         if(ctx.getIoCxt().getRecordIdentifier() == null) {
>           vcValues[i] = null;
>         }
> {code}



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

Mime
View raw message