[ https://issues.apache.org/jira/browse/PIG-5300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Koji Noguchi updated PIG-5300: ------------------------------ Attachment: pig-5300-v01.patch Attaching my first try, {{pig-5300-v01.patch}}. This change will update {noformat} DefaultDataBag DistinctDataBag InternalCachedBag InternalDistinctBag InternalSortedBag SortedDataBag {noformat} which extends from {{DefaultAbstractBag}} and also {{SingleTupleBag}} and {{NonSpillableDataBag}} which have their own implementation of DataBag. NOT touching {{AccumulativeBag}}, {{LimitedSortedDataBag}} and {{ReadOnceBag}} in the belief that they will not be used in hashcode/equals/compareTo. At the same time, I didn't have the courage to throw Exceptions from them. Also added hashcode method to DataBag interface just for documentation purposes. (Just like Map interface in Java.) Also added null check for "equals" calls since java api documents that they should return false (and not throw NPE). > hashCode for Bag needs to be order independent > ----------------------------------------------- > > Key: PIG-5300 > URL: https://issues.apache.org/jira/browse/PIG-5300 > Project: Pig > Issue Type: Bug > Reporter: Koji Noguchi > Assignee: Koji Noguchi > Attachments: pig-5300-v01.patch > > > This is a follow up from PIG-5041 where [~daijy] and others discussed about > {quote} > Anyway, the bag as the key is a different issue. Need to address separately. > Maybe we can write a hashcode which is order independent. > {quote} -- This message was sent by Atlassian JIRA (v6.4.14#64029)