Github user wagnermarkd commented on a diff in the pull request:

    https://github.com/apache/orc/pull/29#discussion_r65451652
  
    --- Diff: java/mapreduce/src/java/org/apache/orc/mapred/OrcMap.java ---
    @@ -83,4 +83,52 @@ public void readFields(DataInput input) throws 
IOException {
           put(key, value);
         }
       }
    +
    +  @Override
    +  public int compareTo(OrcMap<K,V> other) {
    +    if (other == null) {
    +      return -1;
    +    }
    +    int result = keySchema.compareTo(other.keySchema);
    +    if (result != 0) {
    +      return result;
    +    }
    +    result = valueSchema.compareTo(other.valueSchema);
    +    if (result != 0) {
    +      return result;
    +    }
    +    Iterator<Map.Entry<K,V>> ourItr = entrySet().iterator();
    +    Iterator<Map.Entry<K,V>> theirItr = other.entrySet().iterator();
    +    while (ourItr.hasNext() && theirItr.hasNext()) {
    +      Map.Entry<K,V> ourItem = ourItr.next();
    +      Map.Entry<K,V> theirItem = theirItr.next();
    +      K ourKey = ourItem.getKey();
    +      K theirKey = theirItem.getKey();
    +      int val = ((Comparable<K>) ourKey).compareTo(theirKey);
    --- End diff --
    
    Changing the type of K to extend WritableComparable would remove the need 
for this cast


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to