Examples of HowlInputStorageDriver


Examples of org.apache.howl.mapreduce.HowlInputStorageDriver

  public void testConversion() throws IOException {
    Configuration conf = new Configuration();
    JobContext jc = new JobContext(conf, new JobID());

    HowlSchema schema = buildHiveSchema();
    HowlInputStorageDriver isd = new RCFileInputDriver();

    isd.setOriginalSchema(jc, schema);
    isd.setOutputSchema(jc, schema);
    isd.initialize(jc, new Properties());

    byte[][] byteArray = buildBytesArray();

    BytesRefArrayWritable bytesWritable = new BytesRefArrayWritable(byteArray.length);
    for (int i = 0; i < byteArray.length; i++) {
      BytesRefWritable cu = new BytesRefWritable(byteArray[i], 0, byteArray[i].length);
      bytesWritable.set(i, cu);
    }

    //Convert byte array to HowlRecord using isd, convert howlrecord back to byte array
    //using osd, compare the two arrays
    HowlRecord record = isd.convertToHowlRecord(null, bytesWritable);

    HowlOutputStorageDriver osd = new RCFileOutputDriver();

    osd.setSchema(jc, schema);
    osd.initialize(jc, new Properties());
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.