Package org.apache.hadoop.hive.serde2

Examples of org.apache.hadoop.hive.serde2.SerDe.initialize()


      return null;
    }
    SerDe sd = (SerDe) ReflectionUtils.newInstance(desc.getDeserializerClass(),
        null);
    try {
      sd.initialize(null, desc.getProperties());
    } catch (SerDeException e) {
      e.printStackTrace();
      return null;
    }
    return sd;
View Full Code Here


      p.setProperty(org.apache.hadoop.hive.serde.Constants.LIST_COLUMNS,
          cNames.toString());
      p.setProperty(
          org.apache.hadoop.hive.serde.Constants.LIST_COLUMN_TYPES,
          cTypes.toString());
      serDe.initialize(cfg, p);
      return serDe;
    }
    catch (SerDeException se)
    {
      throw new WindowingException(se);
View Full Code Here

   
    serDeProps.setProperty(org.apache.hadoop.hive.serde.Constants.LIST_COLUMNS, colNames.toString());
    serDeProps.setProperty(org.apache.hadoop.hive.serde.Constants.LIST_COLUMN_TYPES, colTypes.toString());
    try
    {
      serde.initialize(hCfg, serDeProps);
    }
    catch(SerDeException se)
    {
      throw new WindowingException("Failed to initialize output SerDe", se);
    }
View Full Code Here

    }

    try
    {
      SerDe serDe = (SerDe) SerDeUtils.lookupDeserializer(serDeClassName);
      serDe.initialize(hConf, serDeProps);
      hiveTable.setSerde(serDe);
      hiveTable.setOI((StructObjectInspector) serDe.getObjectInspector());
    }
    catch (SerDeException se)
    {
View Full Code Here

    Properties serDeProps = output.getOutputSpec().getSerDeProps();

    try
    {
      SerDe serDe = (SerDe) SerDeUtils.lookupDeserializer(serDeClassName);
      serDe.initialize(hConf, serDeProps);
      output.setSerDe(serDe);
    }
    catch (SerDeException se)
    {
      throw new WindowingException(se);
View Full Code Here

      if (serDe instanceof DelimitedJSONSerDe) {
        serdeProp.put(Constants.SERIALIZATION_FORMAT, "" + Utilities.tabCode);
        serdeProp.put(Constants.SERIALIZATION_NULL_FORMAT, "NULL");
      }
   
      serDe.initialize(jcfg, serdeProp);
      /* end: from FetchWork initialize */
   
    return serDe;
    }
    catch(Exception e)
View Full Code Here

    writer.write(serde.serialize(new MyRow(3,2), inspector));
    writer.close(true);
    serde = new OrcSerde();
    properties.setProperty("columns", "x,y");
    properties.setProperty("columns.types", "int:int");
    serde.initialize(conf, properties);
    assertEquals(OrcSerde.OrcSerdeRow.class, serde.getSerializedClass());
    inspector = (StructObjectInspector) serde.getObjectInspector();
    assertEquals("struct<x:int,y:int>", inspector.getTypeName());
    InputFormat<?,?> in = new OrcInputFormat();
    FileInputFormat.setInputPaths(conf, testFilePath.toString());
View Full Code Here

        serde.serialize(new NestedRow(7,8,9), inspector));
    writer.close(Reporter.NULL);
    serde = new OrcSerde();
    properties.setProperty("columns", "z,r");
    properties.setProperty("columns.types", "int:struct<x:int,y:int>");
    serde.initialize(conf, properties);
    inspector = (StructObjectInspector) serde.getObjectInspector();
    InputFormat<?,?> in = new OrcInputFormat();
    FileInputFormat.setInputPaths(conf, testFilePath.toString());
    InputSplit[] splits = in.getSplits(conf, 1);
    assertEquals(1, splits.length);
View Full Code Here

            properties, Reporter.NULL);
    writer.close(true);
    properties.setProperty("columns", "x,y");
    properties.setProperty("columns.types", "int:int");
    SerDe serde = new OrcSerde();
    serde.initialize(conf, properties);
    InputFormat<?,?> in = new OrcInputFormat();
    FileInputFormat.setInputPaths(conf, testFilePath.toString());
    InputSplit[] splits = in.getSplits(conf, 1);
    assertEquals(1, splits.length);
View Full Code Here

    writer.write(serde.serialize(new StringRow("colin"), inspector));
    writer.write(serde.serialize(new StringRow("miles"), inspector));
    writer.close(true);
    serde = new OrcSerde();
    properties.setProperty("columns", "str,str2");
    serde.initialize(conf, properties);
    inspector = (StructObjectInspector) serde.getObjectInspector();
    assertEquals("struct<str:string,str2:string>", inspector.getTypeName());
    InputFormat<?,?> in = new OrcInputFormat();
    FileInputFormat.setInputPaths(conf, testFilePath.toString());
    InputSplit[] splits = in.getSplits(conf, 1);
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.