Package com.datasalt.pangool.io.Schema

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


        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


   */
  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;
  }
 
  /**
   * Creates a field containing a Pangool Tuple.
View Full Code Here

   * @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",Object.class);
    avroField.setObjectSerialization(AvroFieldSerialization.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

  private static Schema getPangoolTweetSchema() {
    Field tweetIdField = Field.create("tweet_id",Schema.Field.Type.INT);
    Field tweetHashTags = Field.createObject("tweet_hashtags",Array.class);
    tweetHashTags.setObjectSerialization(AvroFieldSerialization.class);
    tweetHashTags.addProp("avro.schema",getAvroStringArraySchema().toString());
    return new Schema("tweet",Arrays.asList(tweetIdField,tweetHashTags));
  }
 
  private static Schema getPangoolRetweetSchema(){
    Field userId = Field.create("username",Schema.Field.Type.STRING);
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;
  }

  /**
   * Creates a field containing a Pangool Tuple.
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;
  }
 
  /**
   * Creates a field containing a Pangool Tuple.
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.