Examples of copyObject()


Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveCharObjectInspector.copyObject()

        StringOption option = new StringOption("hello");
        HiveChar value = new HiveChar("hello", 10);

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveJavaObject(option), is(value));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveCharWritable(value)));
        assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue()));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector.copyObject()

        HiveDecimalObjectInspector inspector = (HiveDecimalObjectInspector) serde.getInspector();

        DecimalOption option = new DecimalOption(new BigDecimal("123.45"));
        HiveDecimal value = HiveDecimal.create(new BigDecimal("123.45"));

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveJavaObject(option), is(value));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveDecimalWritable(value)));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector.copyObject()

        DecimalOption option = new DecimalOption(new BigDecimal("123.45"));
        HiveDecimal value = HiveDecimal.create(new BigDecimal("123.45"));

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveJavaObject(option), is(value));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveDecimalWritable(value)));
        assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue()));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveDecimalObjectInspector.copyObject()

        DecimalOption option = new DecimalOption(new BigDecimal("123.45"));
        HiveDecimal value = HiveDecimal.create(new BigDecimal("123.45"));

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveJavaObject(option), is(value));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveDecimalWritable(value)));
        assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue()));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveVarcharObjectInspector.copyObject()

        HiveVarcharObjectInspector inspector = (HiveVarcharObjectInspector) serde.getInspector();

        StringOption option = new StringOption("hello");
        HiveVarchar value = new HiveVarchar("hello", 10);

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        // Note: HiveVarchar.equals(Object) is not defined, but equals(HiveVarchar) is defined
        assertThat(inspector.getPrimitiveJavaObject(option).equals(value), is(true));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveVarcharObjectInspector.copyObject()

        StringOption option = new StringOption("hello");
        HiveVarchar value = new HiveVarchar("hello", 10);

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        // Note: HiveVarchar.equals(Object) is not defined, but equals(HiveVarchar) is defined
        assertThat(inspector.getPrimitiveJavaObject(option).equals(value), is(true));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveVarcharWritable(value)));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveVarcharObjectInspector.copyObject()

        StringOption option = new StringOption("hello");
        HiveVarchar value = new HiveVarchar("hello", 10);

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
        // Note: HiveVarchar.equals(Object) is not defined, but equals(HiveVarchar) is defined
        assertThat(inspector.getPrimitiveJavaObject(option).equals(value), is(true));
        assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
        assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveVarcharWritable(value)));
        assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue()));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector.copyObject()

    });

    IntObjectInspector intOI = (IntObjectInspector)
        OrcLazyObjectInspectorUtils.createLazyObjectInspector(TypeInfoFactory.intTypeInfo);

    OrcLazyInt lazyInt2 = (OrcLazyInt) intOI.copyObject(lazyInt);

    Assert.assertEquals(1, ((IntWritable) lazyInt.materialize()).get());
    Assert.assertEquals(1, ((IntWritable) lazyInt2.materialize()).get());
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector.copyObject()

    });

    IntObjectInspector intOI = (IntObjectInspector)
        OrcLazyObjectInspectorUtils.createLazyObjectInspector(TypeInfoFactory.intTypeInfo);

    OrcLazyInt lazyInt2 = (OrcLazyInt) intOI.copyObject(lazyInt);

    Assert.assertEquals(1, ((IntWritable) lazyInt.materialize()).get());
    Assert.assertEquals(1, ((IntWritable) lazyInt2.materialize()).get());
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector.copyObject()

    });

    LongObjectInspector longOI = (LongObjectInspector)
        OrcLazyObjectInspectorUtils.createLazyObjectInspector(TypeInfoFactory.longTypeInfo);

    OrcLazyLong lazyLong2 = (OrcLazyLong) longOI.copyObject(lazyLong);

    Assert.assertEquals(1, ((LongWritable) lazyLong.materialize()).get());
    Assert.assertEquals(1, ((LongWritable) lazyLong2.materialize()).get());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.