Package org.apache.hadoop.hive.accumulo.serde

Examples of org.apache.hadoop.hive.accumulo.serde.DefaultAccumuloRowIdFactory


    LazySimpleStructObjectInspector objectInspector = (LazySimpleStructObjectInspector) LazyFactory
        .createLazyStructInspector(columns, types, LazySimpleSerDe.DefaultSeparators, new Text(
            "\\N"), false, false, (byte) '\\');

    DefaultAccumuloRowIdFactory rowIdFactory = new DefaultAccumuloRowIdFactory();

    Properties props = new Properties();
    props.setProperty(AccumuloSerDeParameters.COLUMN_MAPPINGS,
        ":rowid,personal:given_name,personal:surname,personal:age,personal:weight,personal:height");
    props.setProperty(serdeConstants.LIST_COLUMNS, Joiner.on(',').join(columns));
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES, Joiner.on(',').join(types));

    AccumuloSerDeParameters params = new AccumuloSerDeParameters(new Configuration(), props,
        AccumuloSerDe.class.getName());

    rowIdFactory.init(params, props);

    LazyAccumuloRow lazyRow = new LazyAccumuloRow(objectInspector);
    AccumuloHiveRow hiveRow = new AccumuloHiveRow("1");
    hiveRow.add("personal", "given_name", "Bob".getBytes());
    hiveRow.add("personal", "surname", "Stevens".getBytes());
View Full Code Here


    LazySimpleStructObjectInspector objectInspector = (LazySimpleStructObjectInspector) LazyFactory
        .createLazyStructInspector(columns, types, LazySimpleSerDe.DefaultSeparators, new Text(
            "\\N"), false, false, (byte) '\\');

    DefaultAccumuloRowIdFactory rowIdFactory = new DefaultAccumuloRowIdFactory();

    Properties props = new Properties();
    props
        .setProperty(AccumuloSerDeParameters.COLUMN_MAPPINGS,
            ":rowid#s,personal:given_name#s,personal:surname#s,personal:age,personal:weight,personal:height");
    props.setProperty(serdeConstants.LIST_COLUMNS, Joiner.on(',').join(columns));
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES, Joiner.on(',').join(types));
    props
        .setProperty(AccumuloSerDeParameters.DEFAULT_STORAGE_TYPE, ColumnEncoding.BINARY.getName());

    AccumuloSerDeParameters params = new AccumuloSerDeParameters(new Configuration(), props,
        AccumuloSerDe.class.getName());

    rowIdFactory.init(params, props);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(baos);

    LazyAccumuloRow lazyRow = new LazyAccumuloRow(objectInspector);
View Full Code Here

    LazySimpleStructObjectInspector objectInspector = (LazySimpleStructObjectInspector) LazyFactory
        .createLazyStructInspector(columns, types, LazySimpleSerDe.DefaultSeparators, new Text(
            "\\N"), false, false, (byte) '\\');

    DefaultAccumuloRowIdFactory rowIdFactory = new DefaultAccumuloRowIdFactory();

    Properties props = new Properties();
    props.setProperty(AccumuloSerDeParameters.COLUMN_MAPPINGS, ":rowid,cf:cq1,cf:cq2,cf:cq3");
    props.setProperty(serdeConstants.LIST_COLUMNS, Joiner.on(',').join(columns));
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES, Joiner.on(',').join(types));

    AccumuloSerDeParameters params = new AccumuloSerDeParameters(new Configuration(), props,
        AccumuloSerDe.class.getName());

    rowIdFactory.init(params, props);

    ColumnMapper columnMapper = params.getColumnMapper();

    LazyAccumuloRow lazyRow = new LazyAccumuloRow(objectInspector);
    AccumuloHiveRow hiveRow = new AccumuloHiveRow("1");
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.accumulo.serde.DefaultAccumuloRowIdFactory

Copyright © 2018 www.massapicom. 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.