com.datasalt.pangool.io
Class Fields

java.lang.Object
  extended by com.datasalt.pangool.io.Fields

public class Fields
extends Object


Field Summary
static char NULLABLE_CHAR
           
 
Constructor Summary
Fields()
           
 
Method Summary
static Schema.Field createAvroField(String name, org.apache.avro.Schema avroSchema)
           
static Schema.Field createAvroField(String name, org.apache.avro.Schema avroSchema, boolean isReflect)
          Creates a field containing an Avro object that will be serialized using AvroFieldSerialization
static Schema.Field createTupleField(String name, Schema schema)
          Deprecated. Use Schema.Field.createTupleField(String, Schema) instead}
static List<Schema.Field> parse(String serialized)
          Parses schemas represented comma separated lists of: (field_name):(field_type)
Available types are: int long boolean float double string Class name (Any class that already supports Hadoop serialization)
Example of schema: name:string,age:int,weight:float
Additionally, fields can handle null values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULLABLE_CHAR

public static char NULLABLE_CHAR
Constructor Detail

Fields

public Fields()
Method Detail

parse

public static List<Schema.Field> parse(String serialized)
Parses schemas represented comma separated lists of: (field_name):(field_type)
Available types are:
Example of schema: name:string,age:int,weight:float
Additionally, fields can handle null values. In this case, an '?' must be added to the end of the type name. For example, if age can have null values, the schema would be:
name:string,age:int?,weight:float


createAvroField

public static Schema.Field createAvroField(String name,
                                           org.apache.avro.Schema avroSchema)
See Also:
#createAvroField(String, org.apache.avro.Schema, boolean)}

createAvroField

public static Schema.Field createAvroField(String name,
                                           org.apache.avro.Schema avroSchema,
                                           boolean isReflect)
Creates a field containing an Avro object that will be serialized using AvroFieldSerialization

Parameters:
name - Field's name
avroSchema - The schema of the field
isReflect - If the object to be serialized needs reflection to be serialized or deserialized
Returns:

createTupleField

public static Schema.Field createTupleField(String name,
                                            Schema schema)
Deprecated. Use Schema.Field.createTupleField(String, Schema) instead}

Creates a field containing a Pangool Tuple.

Parameters:
name - Field's name
schema - The schema of the field
Returns:
the field


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.