Permalink
Browse files

Make PType extend Serializable

Make PType extend Serializable so that PTypes can be passed within
a DoFn to be used with map side joins.
  • Loading branch information...
gabrielreid committed Jun 24, 2012
1 parent 6d701c1 commit 8b64b84f880abeabf09c6958306de20b6202d758
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/com/cloudera/crunch/types/avro/AvroType.java
@@ -57,7 +57,7 @@ public AvroType(Class<T> typeClass, Schema schema, MapFn inputMapFn,
MapFn outputMapFn, PType... ptypes) {
this.typeClass = typeClass;
this.schema = Preconditions.checkNotNull(schema);
- this.schemaString = schema.toString();
+ this.schemaString = schema.toString();
this.baseInputMapFn = inputMapFn;
this.baseOutputMapFn = outputMapFn;
this.subTypes = ImmutableList.<PType> builder().add(ptypes).build();
@@ -79,9 +79,9 @@ public PTypeFamily getFamily() {
}
public Schema getSchema() {
- if (schema == null) {
- schema = new Schema.Parser().parse(schemaString);
- }
+ if (schema == null){
+ schema = new Schema.Parser().parse(schemaString);
+ }
return schema;
}

0 comments on commit 8b64b84

Please sign in to comment.