Package org.apache.hadoop.hive.serde2.objectinspector.primitive

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


    case LIST:
      ListObjectInspector fromLoi = (ListObjectInspector) fromOi;
      List<?> fromList = fromLoi.getList(from);
     
      SettableListObjectInspector toLoi = (SettableListObjectInspector) toOi;
      to = toLoi.create(fromList.size()); // do not reuse
      for (int i = 0; i < fromList.size(); i++) {
        Object converted = convert(fromList.get(i),
            fromLoi.getListElementObjectInspector(),
            toLoi.getListElementObjectInspector());
        toLoi.set(to, i, converted);
View Full Code Here


      }
      return to;
    case MAP:
      MapObjectInspector fromMoi = (MapObjectInspector) fromOi;
      SettableMapObjectInspector toMoi = (SettableMapObjectInspector) toOi;
      to = toMoi.create(); // do not reuse
      for (Map.Entry<?, ?> entry : fromMoi.getMap(from).entrySet()) {
        Object convertedKey = convert(entry.getKey(),
            fromMoi.getMapKeyObjectInspector(),
            toMoi.getMapKeyObjectInspector());
        Object convertedValue = convert(entry.getValue(),
View Full Code Here

   */
  public static OrcStruct createOrcStruct(TypeInfo typeInfo, Object... objs) {
    SettableStructObjectInspector oi = (SettableStructObjectInspector) OrcStruct
        .createObjectInspector(typeInfo);
    List<StructField> fields = (List<StructField>) oi.getAllStructFieldRefs();
    OrcStruct result = (OrcStruct) oi.create();
    result.setNumFields(fields.size());
    for (int i = 0; i < fields.size(); i++) {
      oi.setStructFieldData(result, fields.get(i), objs[i]);
    }
    return result;
View Full Code Here

        return toToi.create(values);
      }
     
      SettableStructObjectInspector toSoi = (SettableStructObjectInspector) toOi;
      List<StructField> toFields = (List<StructField>) toSoi.getAllStructFieldRefs();
      to = toSoi.create();
      for (int i = 0; i < fromItems.size(); i++) {
        Object converted = convert(fromItems.get(i),
            fromFields.get(i).getFieldObjectInspector(),
            toFields.get(i).getFieldObjectInspector());
        toSoi.setStructFieldData(to, toFields.get(i), converted);
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
View Full Code Here

        try {
            serDe.initialize(new Configuration(), tableProperties);

            SettableStructObjectInspector objectInspector = getStandardStructObjectInspector(COLUMN_NAMES, FIELD_INSPECTORS);
            Object row = objectInspector.create();

            List<StructField> fields = ImmutableList.copyOf(objectInspector.getAllStructFieldRefs());

            for (int rowNumber = 0; rowNumber < NUM_ROWS; rowNumber++) {
                for (int i = 0; i < TEST_VALUES.size(); i++) {
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.