Search in sources :

Example 1 with JavaBinaryObjectInspector

use of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaBinaryObjectInspector in project hive by apache.

the class TestLazyBinarySerDe method testJavaBinaryObjectInspector.

/**
   * Test to see if byte[] with correct contents is generated by
   * JavaBinaryObjectInspector from input BytesWritable
   * @throws Throwable
   */
public void testJavaBinaryObjectInspector() throws Throwable {
    BytesWritable bW = getInputBytesWritable();
    //create JavaBinaryObjectInspector
    JavaBinaryObjectInspector binInspector = PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector;
    //convert BytesWritable to byte][
    byte[] outBARef = binInspector.set(null, bW);
    assertTrue("compare input and output BAs", Arrays.equals(inpBArray, outBARef));
}
Also used : JavaBinaryObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaBinaryObjectInspector) BytesWritable(org.apache.hadoop.io.BytesWritable)

Aggregations

JavaBinaryObjectInspector (org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaBinaryObjectInspector)1 BytesWritable (org.apache.hadoop.io.BytesWritable)1