Package org.apache.hadoop.hive.serde2.columnar

Examples of org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe.initialize()


        props.setProperty(Constants.LIST_COLUMN_TYPES,
            HiveRCSchemaUtil.listToString(types));

        Configuration hiveConf = new HiveConf(conf, SessionState.class);
        ColumnarSerDe serde = new ColumnarSerDe();
        serde.initialize(hiveConf, props);

        return (ColumnarStruct) serde.deserialize(buff);
   }

View Full Code Here


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

      // Data
      BytesRefArrayWritable braw = new BytesRefArrayWritable(8);
      String[] data = {"123", "456", "789", "1000", "5.3", "hive and hadoop", "1.", "NULL"};
      for (int i = 0; i < 8; i++) {
View Full Code Here

    Path file = null;
    // the SerDe part is from TestLazySimpleSerDe
    AbstractSerDe serDe = new ColumnarSerDe();
    // Create the SerDe
    Properties tbl = createProperties();
    serDe.initialize(conf, tbl);

    String usage = "Usage: RCFile " + "[-count N]" + " file";
    if (args.length == 0) {
      System.err.println(usage);
      System.exit(-1);
View Full Code Here

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

      // Data
      BytesRefArrayWritable braw = new BytesRefArrayWritable(8);
      String[] data = {"123", "456", "789", "1000", "5.3", "hive and hadoop", "1.", "NULL"};
      for (int i = 0; i < 8; i++) {
View Full Code Here

    serDDL = serDDL.concat("}");

    dsp.setProperty(Constants.SERIALIZATION_DDL, serDDL);
    dsp.setProperty(Constants.SERIALIZATION_LIB, ds.getClass().toString());
    dsp.setProperty(Constants.FIELD_DELIM, "9");
    ds.initialize(new Configuration(), dsp);

    String row = client.fetchOne();
    Object o = ds.deserialize(new BytesWritable(row.getBytes()));

    assertEquals(o.getClass().toString(), "class java.util.ArrayList");
View Full Code Here

    serDDL = serDDL.concat("}");

    dsp.setProperty(Constants.SERIALIZATION_DDL, serDDL);
    // Need a new DynamicSerDe instance - re-initialization is not supported.
    ds = new DynamicSerDe();
    ds.initialize(new Configuration(), dsp);
    o = ds.deserialize(new BytesWritable(row.getBytes()));
  }

}
View Full Code Here

            schema.setProperty(e.getKey(), e.getValue());
          }
        }
 
        DynamicSerDe serde = new DynamicSerDe();
        serde.initialize(new Configuration(), schema);
       
        // Try getObjectInspector
        ObjectInspector oi = serde.getObjectInspector();
        System.out.println("TypeName = " + oi.getTypeName());
View Full Code Here

    schema.setProperty(Constants.SERIALIZATION_DDL, ddl);
    schema.setProperty(Constants.SERIALIZATION_LIB, DynamicSerDe.class.getName());
    schema.setProperty(Constants.SERIALIZATION_SORT_ORDER, order);

    DynamicSerDe serde = new DynamicSerDe();
    serde.initialize(new Configuration(), schema);

    ObjectInspector oi = serde.getObjectInspector();

    // Try to serialize
    BytesWritable bytes[] = new BytesWritable[structs.length];
View Full Code Here

      schema.setProperty(Constants.COLLECTION_DELIM, "1");
      schema.setProperty(Constants.LINE_DELIM, "2");
      schema.setProperty(Constants.MAPKEY_DELIM, "4");

      DynamicSerDe serde = new DynamicSerDe();
      serde.initialize(new Configuration(), schema);

      TCTLSeparatedProtocol prot = (TCTLSeparatedProtocol)serde.oprot_;
      assertTrue(prot.getPrimarySeparator().equals("\u0009"));
     
      ObjectInspector oi = serde.getObjectInspector();
View Full Code Here

                         "struct test { i32 hello, list<string> bye, map<string,i32> another}");
      schema.setProperty(Constants.SERIALIZATION_LIB, new DynamicSerDe().getClass().toString());
      schema.setProperty(TCTLSeparatedProtocol.ReturnNullsKey, "true");

      DynamicSerDe serde = new DynamicSerDe();
      serde.initialize(new Configuration(), schema);

      ObjectInspector oi = serde.getObjectInspector();
     
      // Try to serialize
      BytesWritable bytes = (BytesWritable) serde.serialize(struct, oi);
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.