Examples of WritableStringObjectInspector


Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

   *          - value
   * @return raw data size
   */
  public static long getWritableSize(ObjectInspector oi, Object value) {
    if (oi instanceof WritableStringObjectInspector) {
      WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
      return JavaDataModel.get().lengthForStringOfLength(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBinaryObjectInspector) {
      WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;
      return JavaDataModel.get().lengthForByteArrayOfSize(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBooleanObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableByteObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableDateObjectInspector) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

   *          - value
   * @return raw data size
   */
  public static long getWritableSize(ObjectInspector oi, Object value) {
    if (oi instanceof WritableStringObjectInspector) {
      WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
      return JavaDataModel.get().lengthForStringOfLength(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBinaryObjectInspector) {
      WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;
      return JavaDataModel.get().lengthForByteArrayOfSize(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBooleanObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableByteObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableDateObjectInspector) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

    if (arguments.length < 1) {
      throw new UDFArgumentLengthException(
          "The function PRINTF(String format, Obj... args) needs at least one arguments.");
    }

    WritableStringObjectInspector resultOI = PrimitiveObjectInspectorFactory.writableStringObjectInspector;

    if (arguments[0].getCategory() == ObjectInspector.Category.PRIMITIVE) {
      PrimitiveObjectInspector poi = ((PrimitiveObjectInspector) arguments[0]);
      if (poi.getPrimitiveCategory() == PrimitiveObjectInspector.PrimitiveCategory.STRING ||
          poi.getPrimitiveCategory() == PrimitiveObjectInspector.PrimitiveCategory.CHAR ||
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

   *          - value
   * @return raw data size
   */
  public static long getWritableSize(ObjectInspector oi, Object value) {
    if (oi instanceof WritableStringObjectInspector) {
      WritableStringObjectInspector woi = (WritableStringObjectInspector) oi;
      return JavaDataModel.get().lengthForStringOfLength(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBinaryObjectInspector) {
      WritableBinaryObjectInspector woi = (WritableBinaryObjectInspector) oi;
      return JavaDataModel.get().lengthForByteArrayOfSize(
          woi.getPrimitiveWritableObject(value).getLength());
    } else if (oi instanceof WritableBooleanObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableByteObjectInspector) {
      return JavaDataModel.get().primitive1();
    } else if (oi instanceof WritableDateObjectInspector) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

  ///@Test
  public void testCollectMaxAggBuffer() throws HiveException {
    MapCollectMaxUDAFEvaluator maxEval = new MapCollectMaxUDAFEvaluator(true);
 
    WritableStringObjectInspector keyOI = (WritableStringObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.STRING);
    WritableIntObjectInspector valOI = (WritableIntObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.INT);
   
   
    maxEval.init( Mode.PARTIAL1, new ObjectInspector[] { keyOI, valOI} );
   
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector

   
  @Test
  public void testCollectMinAggBuffer() throws HiveException {
    MapCollectMaxUDAFEvaluator maxEval = new MapCollectMaxUDAFEvaluator(false);
 
    WritableStringObjectInspector keyOI = (WritableStringObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.STRING);
    WritableIntObjectInspector valOI = (WritableIntObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.INT);
   
   
    maxEval.init( Mode.PARTIAL1, new ObjectInspector[] { keyOI, valOI} );
   
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.