Package org.apache.hadoop.zebra.mapreduce

Examples of org.apache.hadoop.zebra.mapreduce.TableInputFormat


  public void testTfileSplit1()
  throws IOException, ParseException {
    BasicTable.drop(path, conf);
    TestBasicTable.createBasicTable(1, 100, "a, b, c, d, e, f", "[a, b]; [c, d]", null, path, true);   

    TableInputFormat inputFormat = new TableInputFormat();
    Job job = new Job(conf);
    inputFormat.setInputPaths(job, path);
    inputFormat.setMinSplitSize(job, 100);
    inputFormat.setProjection(job, "aa");
    List<InputSplit> splits = inputFormat.getSplits(job);

    RowTableSplit split = (RowTableSplit) splits.get(0);
    String str = split.getSplit().toString();
    StringTokenizer tokens = new StringTokenizer(str, "\n");
    str = tokens.nextToken();
View Full Code Here


    BasicTable.drop(path, conf);
    TestBasicTable.createBasicTable(1, 100, "a, b, c, d, e, f", "[a, b]; [c, d]", null, path, true);   
    BasicTable.dropColumnGroup(path, conf, "CG0");
    BasicTable.dropColumnGroup(path, conf, "CG2");

    TableInputFormat inputFormat = new TableInputFormat();
    Job job = new Job(conf);
    inputFormat.setInputPaths(job, path);
    inputFormat.setMinSplitSize(job, 100);
    List<InputSplit> splits = inputFormat.getSplits(job);

    RowTableSplit split = (RowTableSplit) splits.get( 0 );
    String str = split.getSplit().toString();
    StringTokenizer tokens = new StringTokenizer(str, "\n");
    str = tokens.nextToken();
View Full Code Here

    TestBasicTable.createBasicTable(1, 100, "a, b, c, d, e, f", "[a, b]; [c, d]", null, path, true);   
    BasicTable.dropColumnGroup(path, conf, "CG0");
    BasicTable.dropColumnGroup(path, conf, "CG1");
    BasicTable.dropColumnGroup(path, conf, "CG2");

    TableInputFormat inputFormat = new TableInputFormat();
    Job job = new Job(conf);
    inputFormat.setInputPaths(job, path);
    inputFormat.setMinSplitSize(job, 100);
    List<InputSplit> splits = inputFormat.getSplits(job);

    Assert.assertEquals(splits.size(), 0);
  }
View Full Code Here

  @Test
  public void testSortedSplitOrdering() throws IOException, ParseException {
    BasicTable.drop(path, conf);
    TestBasicTable.createBasicTable(1, 1000000, "a, b, c, d, e, f", "[a, e, d]", "a", path, true);   

    TableInputFormat inputFormat = new TableInputFormat();
    Job job = new Job(conf);
    inputFormat.setInputPaths(job, path);
    inputFormat.setMinSplitSize(job, 100);
    inputFormat.setProjection(job, "d");
    inputFormat.requireSortedTable( job, null );
    List<InputSplit> splits = inputFormat.getSplits(job);
   
    int index = 0;
    for( InputSplit is : splits ) {
      Assert.assertTrue( is instanceof SortedTableSplit );
      SortedTableSplit split = (SortedTableSplit)is;
View Full Code Here

    Job job = new Job(conf);
    System.out.println("sortKey: " + sortKey);
    TableInputFormat.setInputPaths(job, new Path(pathTable1));

    TableInputFormat.requireSortedTable(job, null);
    TableInputFormat tif = new TableInputFormat();

    SortedTableSplit split = (SortedTableSplit) tif.getSplits(job, true).get(0);

    TableScanner scanner = reader.getScanner(split.getBegin(), split.getEnd(), true);
    BytesWritable key = new BytesWritable();
    Tuple rowValue = TypesUtils.createTuple(scanner.getSchema());
View Full Code Here

     }

     @SuppressWarnings("unchecked")
     @Override
     public InputFormat getInputFormat() throws IOException {
         return new TableInputFormat();
     }
View Full Code Here

     }

     @SuppressWarnings("unchecked")
     @Override
     public InputFormat getInputFormat() throws IOException {
         return new TableInputFormat();
     }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.mapreduce.TableInputFormat

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.