Package com.datasalt.pangool.tuplemr

Examples of com.datasalt.pangool.tuplemr.TupleMRConfigBuilder


        Fields.parse("boolean_field:boolean, int_field:int, long_field:long,strField:string")));
    schemas.add(new Schema("schema5",
        Fields.parse("boolean_field:boolean, int_field:int, long_field:long,strField:string, " +
            "enum_field:" + TestEnum.class.getName() + ",thrift_field:" + A.class.getName())));
    schemas.add(SCHEMA);
    TupleMRConfigBuilder b = new TupleMRConfigBuilder();
    for (int i = 0; i < schemas.size(); i++) {
      Schema schema = schemas.get(i);
      if (withNullables) {
        schema = decorateWithNullables(schema);
      }
      b.addIntermediateSchema(schema);
    }
    b.setGroupByFields("boolean_field", "int_field");
    b.setOrderBy(new OrderBy().add("boolean_field", Order.ASC).add("int_field", Order.DESC).addSchemaOrder(Order.DESC));
    b.setSpecificOrderBy("schema1", new OrderBy().add("string_field", Order.DESC));
    b.setSpecificOrderBy("schema2", new OrderBy().add("long_field", Order.ASC));
    return b.buildConf();
  }
View Full Code Here


    fields.add(Field.create("number1", Type.INT));
    fields.add(Field.create("string1", Type.STRING));
    fields.add(Field.create("number2", Type.LONG));
    Schema schema2 = new Schema("test2", fields);
   
    TupleMRConfigBuilder builder = new TupleMRConfigBuilder();
    builder.addIntermediateSchema(schema1);
    builder.addIntermediateSchema(schema2);
    builder.setGroupByFields("number1", "string1");
    TupleMRConfig tupleMRConf = builder.buildConf();
    TupleMRConfig.set(tupleMRConf, conf);
   
    partitioner.setConf(conf);
   
    ITuple tuple = new Tuple(schema1);
View Full Code Here

    List<Field> fields = new ArrayList<Field>();
    // We use one INT field - we'll put random numbers in it
    fields.add(Field.create("foo", Type.INT));
    Schema schema = new Schema("test", fields);
   
    TupleMRConfigBuilder builder = new TupleMRConfigBuilder();
    builder.addIntermediateSchema(schema);
    builder.setGroupByFields("foo");
    TupleMRConfig tupleMRConf = builder.buildConf();
    TupleMRConfig.set(tupleMRConf, conf);
   
    partitioner.setConf(conf);
   
    ITuple tuple = new Tuple(schema);
View Full Code Here

  }
 
  protected void setConf(SortComparator comparator) throws TupleMRException, IOException  {
   
    Configuration conf = getConf();
    TupleMRConfigBuilder b = new TupleMRConfigBuilder();
    b.addIntermediateSchema(schema1);
    b.addIntermediateSchema(schema2);
    b.setGroupByFields("booleanField", "intField");
    b.setOrderBy(new OrderBy().add("booleanField",Order.ASC).add("intField",Order.DESC).addSchemaOrder(Order.DESC));
    b.setSpecificOrderBy("schema1",new OrderBy().add("strField",Order.DESC));
    b.setSpecificOrderBy("schema2",new OrderBy().add("longField",Order.DESC));
    TupleMRConfig config = b.buildConf();
    TupleMRConfig.set(config, conf);
    comparator.setConf(conf);
  }
View Full Code Here

TOP

Related Classes of com.datasalt.pangool.tuplemr.TupleMRConfigBuilder

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.