Package org.apache.hadoop.hive.serde2.lazy

Examples of org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.initialize()


        LazySimpleSerDe serde = new LazySimpleSerDe();
        Configuration conf = new Configuration();
        Properties tbl = new Properties();
        tbl.setProperty("columns", "key,value");
        tbl.setProperty("columns.types", keyOI.getTypeName() + "," + valueOI.getTypeName());
        serde.initialize(conf, tbl);
        return serde;
    }

    public static LazySimpleSerDe getLineSerde(PrimitiveObjectInspector... OIs)
            throws SerDeException {
View Full Code Here


        columnNames.deleteCharAt(columnNames.length() - 1);
        columnTypes.deleteCharAt(columnTypes.length() - 1);

        tbl.setProperty("columns", columnNames.toString());
        tbl.setProperty("columns.types", columnTypes.toString());
        serde.initialize(conf, tbl);
        return serde;
    }
}
View Full Code Here

          throws SerializationError {
    try {
      Properties tableProps = MetaStoreUtils.getTableMetadata(tbl);
      tableProps.setProperty("field.delim", String.valueOf(serdeSeparator));
      LazySimpleSerDe serde = new LazySimpleSerDe();
      serde.initialize(conf, tableProps);
      return serde;
    } catch (SerDeException e) {
      throw new SerializationError("Error initializing serde", e);
    }
  }
View Full Code Here

      // Create the SerDe
      System.out.println("test: testLazySimpleSerDe");
      LazySimpleSerDe serDe = new LazySimpleSerDe();
      Configuration conf = new Configuration();
      Properties tbl = createProperties();
      serDe.initialize(conf, tbl);

      // Data
      Text t = new Text("123\t456\t789\t1000\t5.3\thive and hadoop\t1.\tNULL");
      // Test
      deserializeAndSerializeLazySimple(serDe, t);
View Full Code Here

    p.setProperty(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS,
        serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS));
    p.setProperty(
        org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES,
        serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES));
    serDe.initialize(cfg, p);
    return serDe;
  }

  @SuppressWarnings({"unchecked"})
View Full Code Here

    ObjectOutputStream out = new ObjectOutputStream(baos);
    LazyBinarySerDe serde = new LazyBinarySerDe();
    Properties props = new Properties();
    props.put(serdeConstants.LIST_COLUMNS, columns);
    props.put(serdeConstants.LIST_COLUMN_TYPES, types);
    serde.initialize(null, props);
    MapJoinObjectSerDeContext context = new MapJoinObjectSerDeContext(serde, false);   
    key.write(context, out);
    out.close();
    bais = new ByteArrayInputStream(baos.toByteArray());
    in = new ObjectInputStream(bais);
View Full Code Here

    ObjectOutputStream out = new ObjectOutputStream(baos);
    LazyBinarySerDe serde = new LazyBinarySerDe();
    Properties props = new Properties();
    props.put(serdeConstants.LIST_COLUMNS, columns);
    props.put(serdeConstants.LIST_COLUMN_TYPES, types);
    serde.initialize(null, props);
    MapJoinObjectSerDeContext context = new MapJoinObjectSerDeContext(serde, true);   
    container.write(context, out);
    out.close();
    bais = new ByteArrayInputStream(baos.toByteArray());
    in = new ObjectInputStream(bais);
View Full Code Here

   
    LazyBinarySerDe keySerde = new LazyBinarySerDe();
    Properties keyProps = new Properties();
    keyProps.put(serdeConstants.LIST_COLUMNS, "v1");
    keyProps.put(serdeConstants.LIST_COLUMN_TYPES, "string");
    keySerde.initialize(null, keyProps);
    LazyBinarySerDe valueSerde = new LazyBinarySerDe();
    Properties valueProps = new Properties();
    valueProps.put(serdeConstants.LIST_COLUMNS, "v1");
    valueProps.put(serdeConstants.LIST_COLUMN_TYPES, "string");
    valueSerde.initialize(null, keyProps);
View Full Code Here

    keySerde.initialize(null, keyProps);
    LazyBinarySerDe valueSerde = new LazyBinarySerDe();
    Properties valueProps = new Properties();
    valueProps.put(serdeConstants.LIST_COLUMNS, "v1");
    valueProps.put(serdeConstants.LIST_COLUMN_TYPES, "string");
    valueSerde.initialize(null, keyProps);
    containerSerde = new MapJoinTableContainerSerDe(
        new MapJoinObjectSerDeContext(keySerde, false),
        new MapJoinObjectSerDeContext(valueSerde, false));
    container = new HashMapWrapper();
  }
View Full Code Here

      Properties schema = new Properties();
      schema.setProperty(Constants.LIST_COLUMNS, fieldNames);
      schema.setProperty(Constants.LIST_COLUMN_TYPES, fieldTypes);

      LazyBinarySerDe serDe = new LazyBinarySerDe();
      serDe.initialize(new Configuration(), schema);

      deserializeAndSerializeLazyBinary(serDe, rows, rowOI);
      System.out.println("test: testLazyBinarySerDe - OK");

    } catch (Throwable e) {
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.