[ https://issues.apache.org/jira/browse/THRIFT-723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840959#action_12840959 ]
Dmitry Chechik commented on THRIFT-723: --------------------------------------- For what it's worth, neither Lists, Sets or Maps are Comparable in the Java JDK implementation, but thrift implement comparison for Lists anyway -- might as well do it for the other basic types. This allows thrift buffers with those types to be used as keys in mapreduce operations so it's fairly useful. As another data point, python implements comparison of dictionaries (i.e. Maps) in the same way -- if the dictionaries are the same size, the keys are sorted and then compared. > Thrift buffers with set and map types in Java should implement Comparable > ------------------------------------------------------------------------- > > Key: THRIFT-723 > URL: https://issues.apache.org/jira/browse/THRIFT-723 > Project: Thrift > Issue Type: Bug > Components: Compiler (Java), Library (Java) > Reporter: Dmitry Chechik > Attachments: thrift-compare-to.patch > > > Currently, Thrift objects in Java don't implement Comparable if any field is > a set or a map. > The patch attached implements Comparable for those cases. If we can compare a > List, we should be able to compare a Set just as easily. This implementation > compares two thrift objects by comparing the sorted entries of each set or > map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.