Examples of create()


Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaHiveVarcharObjectInspector.create()

    baos.reset();
    HiveVarchar varcharValue = new HiveVarchar("varchar", 7);
    JavaHiveVarcharObjectInspector varcharOI = (JavaHiveVarcharObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new VarcharTypeInfo(7));
    LazyUtils.writePrimitiveUTF8(baos, varcharOI.create(varcharValue), varcharOI, false, (byte) 0,
        null);
    m.put(cfBytes, "varchar".getBytes(), baos.toByteArray());

    writer.addMutation(m);

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaStringObjectInspector.create()

    // string
    String stringValue = "string";
    JavaStringObjectInspector stringOI = (JavaStringObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.STRING_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, stringOI.create(stringValue), stringOI, false, (byte) 0,
        null);
    m.put(cfBytes, "string".getBytes(), baos.toByteArray());

    // boolean
    boolean booleanValue = true;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaTimestampObjectInspector.create()

    Timestamp timestampValue = new Timestamp(now.getTime());
    baos.reset();
    JavaTimestampObjectInspector timestampOI = (JavaTimestampObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.TIMESTAMP_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, timestampOI.create(timestampValue), timestampOI, false,
        (byte) 0, null);
    m.put(cfBytes, "timestamp".getBytes(), baos.toByteArray());

    // char
    baos.reset();

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableBinaryObjectInspector.create()

      case SHORT:
        SettableShortObjectInspector shortOi = (SettableShortObjectInspector) toOi;
        return shortOi.create((Short) fromPoi.getPrimitiveJavaObject(from));
      case BINARY:
        SettableBinaryObjectInspector binOi = (SettableBinaryObjectInspector) toOi;
        return binOi.create((byte[]) fromPoi.getPrimitiveJavaObject(from));
      case TIMESTAMP:
        SettableTimestampObjectInspector timeOi = (SettableTimestampObjectInspector) toOi;
        return timeOi.create((Timestamp) fromPoi.getPrimitiveJavaObject(from));
      case DATE:
        SettableDateObjectInspector dateOi = (SettableDateObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableBooleanObjectInspector.create()

      case DOUBLE:
        SettableDoubleObjectInspector doubleOi = (SettableDoubleObjectInspector) toOi;
        return doubleOi.create((Double) fromPoi.getPrimitiveJavaObject(from));
      case BOOLEAN:
        SettableBooleanObjectInspector boolOi = (SettableBooleanObjectInspector) toOi;
        return boolOi.create((Boolean) fromPoi.getPrimitiveJavaObject(from));
      case INT:
        SettableIntObjectInspector intOi = (SettableIntObjectInspector) toOi;
        return intOi.create((Integer) fromPoi.getPrimitiveJavaObject(from));
      case LONG:
        SettableLongObjectInspector longOi = (SettableLongObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableByteObjectInspector.create()

      case STRING:
        SettableStringObjectInspector strOi = (SettableStringObjectInspector) toOi;
        return strOi.create((String) fromPoi.getPrimitiveJavaObject(from));
      case BYTE:
        SettableByteObjectInspector byteOi = (SettableByteObjectInspector) toOi;
        return byteOi.create((Byte) fromPoi.getPrimitiveJavaObject(from));
      case SHORT:
        SettableShortObjectInspector shortOi = (SettableShortObjectInspector) toOi;
        return shortOi.create((Short) fromPoi.getPrimitiveJavaObject(from));
      case BINARY:
        SettableBinaryObjectInspector binOi = (SettableBinaryObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableDateObjectInspector.create()

      case TIMESTAMP:
        SettableTimestampObjectInspector timeOi = (SettableTimestampObjectInspector) toOi;
        return timeOi.create((Timestamp) fromPoi.getPrimitiveJavaObject(from));
      case DATE:
        SettableDateObjectInspector dateOi = (SettableDateObjectInspector) toOi;
        return dateOi.create((Date) fromPoi.getPrimitiveJavaObject(from));
      case DECIMAL:
        SettableHiveDecimalObjectInspector decimalOi = (SettableHiveDecimalObjectInspector) toOi;
        return decimalOi.create((HiveDecimal) fromPoi.getPrimitiveJavaObject(from));
      case CHAR:
        SettableHiveCharObjectInspector charOi = (SettableHiveCharObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableDoubleObjectInspector.create()

      case FLOAT:
        SettableFloatObjectInspector floatOi = (SettableFloatObjectInspector) toOi;
        return floatOi.create((Float) fromPoi.getPrimitiveJavaObject(from));
      case DOUBLE:
        SettableDoubleObjectInspector doubleOi = (SettableDoubleObjectInspector) toOi;
        return doubleOi.create((Double) fromPoi.getPrimitiveJavaObject(from));
      case BOOLEAN:
        SettableBooleanObjectInspector boolOi = (SettableBooleanObjectInspector) toOi;
        return boolOi.create((Boolean) fromPoi.getPrimitiveJavaObject(from));
      case INT:
        SettableIntObjectInspector intOi = (SettableIntObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableFloatObjectInspector.create()

    case PRIMITIVE:
      PrimitiveObjectInspector fromPoi = (PrimitiveObjectInspector) fromOi;
      switch (fromPoi.getPrimitiveCategory()) {
      case FLOAT:
        SettableFloatObjectInspector floatOi = (SettableFloatObjectInspector) toOi;
        return floatOi.create((Float) fromPoi.getPrimitiveJavaObject(from));
      case DOUBLE:
        SettableDoubleObjectInspector doubleOi = (SettableDoubleObjectInspector) toOi;
        return doubleOi.create((Double) fromPoi.getPrimitiveJavaObject(from));
      case BOOLEAN:
        SettableBooleanObjectInspector boolOi = (SettableBooleanObjectInspector) toOi;

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableHiveCharObjectInspector.create()

      case DECIMAL:
        SettableHiveDecimalObjectInspector decimalOi = (SettableHiveDecimalObjectInspector) toOi;
        return decimalOi.create((HiveDecimal) fromPoi.getPrimitiveJavaObject(from));
      case CHAR:
        SettableHiveCharObjectInspector charOi = (SettableHiveCharObjectInspector) toOi;
        return charOi.create((HiveChar) fromPoi.getPrimitiveJavaObject(from));
      case VARCHAR:
        SettableHiveVarcharObjectInspector varcharOi = (SettableHiveVarcharObjectInspector) toOi;
        return varcharOi.create((HiveVarchar) fromPoi.getPrimitiveJavaObject(from));
      case VOID:
        throw new IllegalArgumentException("Void type is not supported yet");
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.