[
https://issues.apache.org/jira/browse/PHOENIX-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14249074#comment-14249074
]
Nick Dimiduk commented on PHOENIX-1514:
---------------------------------------
Here's an equals(Object) implementation for PrimitiveDoublePhoenixArray. It
allows these UT's to pass.
{noformat}
@@ -395,13 +398,13 @@ public class PhoenixArray implements Array,SQLCloseable {
@Override
public boolean equals(Object obj) {
- if (this.numElements != ((PhoenixArray)
obj).numElements) {
- return false;
- }
- if (this.baseType != ((PhoenixArray) obj).baseType) {
- return false;
- }
- return Arrays.equals((Object[]) this.array, (Object[])
((PhoenixArray) obj).array);
+ if (obj == null) return false;
+ if (this == obj) return true;
+ if (this.getClass() != obj.getClass()) return false;
+ PrimitiveDoublePhoenixArray oArray = (PrimitiveDoublePhoenixArray) obj;
+ if (numElements != oArray.numElements) return false;
+ if (baseType.getSqlType() != oArray.baseType.getSqlType()) return false;
+ return Arrays.equals((double[]) array, (double[]) oArray.array);
}
}
{noformat}
> Break up PDataType Enum
> -----------------------
>
> Key: PHOENIX-1514
> URL: https://issues.apache.org/jira/browse/PHOENIX-1514
> Project: Phoenix
> Issue Type: Sub-task
> Affects Versions: 5.0.0
> Reporter: Nick Dimiduk
> Assignee: Nick Dimiduk
> Fix For: 5.0.0
>
> Attachments: PHOENIX-1514.00.patch, PHOENIX-1514.01.patch,
> PHOENIX-1514.02.patch, hung-phoenix-verify.txt, stack.txt
>
>
> A first step in adopting (a portion of) HBase's type encodings is to break up
> the PDataType enum into an interface. This will pave the way for more
> flexibility going forward.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)