@Test(expected = TupleMRException.class) public void testGroupByObjectDifferentSerialization() throws TupleMRException { TupleMRConfigBuilder b = new TupleMRConfigBuilder(); List<Field> fields = new ArrayList<Field>(); fields.add(Field.createObject("my_object", A.class)); b.addIntermediateSchema(new Schema("schema1", fields)); fields.clear(); Field avroField = Field.createObject("my_object", Object.class); avroField.setObjectSerialization(AvroFieldSerialization.class); fields.add(avroField); b.addIntermediateSchema(new Schema("schema2", fields)); b.setGroupByFields("my_object"); b.buildConf(); }
@Test public void testGroupByObjectSameSerialization() throws TupleMRException { TupleMRConfigBuilder b = new TupleMRConfigBuilder(); List<Field> fields = new ArrayList<Field>(); fields.add(Field.createObject("my_object", A.class)); b.addIntermediateSchema(new Schema("schema1", fields)); b.addIntermediateSchema(new Schema("schema2", fields)); b.setGroupByFields("my_object"); b.buildConf(); }
static { List<Field> fields = new ArrayList<Field>(); fields.add(Field.create("int_field", Type.INT)); fields.add(Field.create("string_field", Type.STRING)); fields.add(Field.create("long_field", Type.LONG)); fields.add(Field.create("float_field", Type.FLOAT)); fields.add(Field.create("double_field", Type.DOUBLE)); fields.add(Field.create("boolean_field", Type.BOOLEAN)); fields.add(Field.createEnum("enum_field", Order.class)); fields.add(Field.createObject("thrift_field", A.class)); SCHEMA = new Schema("schema", fields); }
@Before public void init() throws TupleMRException { this.schema1 = new Schema( "schema1", Fields.parse("int_field:int, string_field:string,boolean_field:boolean")); this.schema2 = new Schema("schema2", Fields.parse("long_field:long,boolean_field:boolean, int_field:int")); List<Field> fields = new ArrayList<Field>(); fields.add(Field.create("int_field", Type.INT)); fields.add(Field.create("string_field", Type.STRING)); fields.add(Field.create("long_field", Type.LONG)); fields.add(Field.create("float_field", Type.FLOAT)); fields.add(Field.create("double_field", Type.DOUBLE)); fields.add(Field.create("boolean_field", Type.BOOLEAN)); fields.add(Field.createEnum("enum_field", Order.class)); fields.add(Field.createObject("thrift_field", A.class)); this.schema3 = new Schema("schema3", fields); }