Package com.datasalt.pangool.io.Schema

Examples of com.datasalt.pangool.io.Schema.Field.addProp()


   * @return
   */
  public static Field createTupleField(String name, Schema schema) {
    Field field = Field.createObject(name,Object.class);
    field.setObjectSerialization(TupleFieldSerialization.class);
    field.addProp("schema", schema.toString());
    return field;
  }
}
View Full Code Here


  }

  static Schema getSchema() {
    org.apache.avro.Schema avroSchema = getAvroSchema();
    Field avroField = Field.createObject("my_avro",AvroFieldSerializer.class,AvroFieldDeserializer.class);
    avroField.addProp("avro.schema",avroSchema.toString());
    return new Schema("schema",Arrays.asList(avroField));
  }
 
  static org.apache.avro.Schema getAvroSchema(){
    List<org.apache.avro.Schema.Field> avroFields =
View Full Code Here

   */
  public static Field createAvroField(String name,
       org.apache.avro.Schema avroSchema,  boolean isReflect){
    Field field = Field.createObject(name,Object.class);
    field.setObjectSerialization(AvroFieldSerialization.class);
    field.addProp("avro.schema",avroSchema.toString());
    field.addProp("avro.reflection",Boolean.toString(isReflect));
    return field;
  }
}
View Full Code Here

  public static Field createAvroField(String name,
       org.apache.avro.Schema avroSchema,  boolean isReflect){
    Field field = Field.createObject(name,Object.class);
    field.setObjectSerialization(AvroFieldSerialization.class);
    field.addProp("avro.schema",avroSchema.toString());
    field.addProp("avro.reflection",Boolean.toString(isReflect));
    return field;
  }
}
View Full Code Here

        throw new PangoolRuntimeException("Avro type:" + type + " can't be converted to Pangool Schema type");
      }
      //add properties
      for(Map.Entry<String,String> entry : avroField.props().entrySet()){
        if (!Field.RESERVED_KEYWORDS.contains(entry.getKey())){
          pangoolField.addProp(entry.getKey(),entry.getValue());
        }
      }
      fields.add(pangoolField);
     
    }
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.