org.apache.hadoop.hive.serde2.objectinspector
Class ListObjectsEqualComparer

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.ListObjectsEqualComparer

public class ListObjectsEqualComparer
extends Object

Compare two list of objects. Two lists are expected to have same types. Type information for every object is passed when calling Constructor to avoid the step of figuring out types from ObjectInspetor and determine how to compare the types when comparing. Also, for string and text elements, it performs slightly better than using ObjectInspectorUtils.compare() == 0, which instead of calling .compare() calls .equalTo(), which compares size before byte by byte comparison.


Constructor Summary
ListObjectsEqualComparer(ObjectInspector[] oi0, ObjectInspector[] oi1)
           
 
Method Summary
 boolean areEqual(Object[] ol0, Object[] ol1)
          ol0, ol1 should have equal or less number of elements than objectinspectors passed in constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListObjectsEqualComparer

public ListObjectsEqualComparer(ObjectInspector[] oi0,
                                ObjectInspector[] oi1)
Method Detail

areEqual

public boolean areEqual(Object[] ol0,
                        Object[] ol1)
ol0, ol1 should have equal or less number of elements than objectinspectors passed in constructor.

Parameters:
ol0 -
ol1 -
Returns:
True if object in ol0 and ol1 are all identical


Copyright © 2012 The Apache Software Foundation