Wednesday, October 12, 2016

Tuple, Fields & Data type coercion...


  1. Tuple #31
    1. cascading.tuple.Tuple
    2. Data is represented as Tuple in Cascading
    3. Elements in a Tuple is represented by Fields #32
    4. ----- Methods
    5. size(): Tuple
      1. Used to create a Tuple of given size #31
    6. getObject(): Object
      1. Returns the element at a given position #32
      2. ----- Related
      3. getBoolean(), getString(), getFloat(), getDouble(), getInteger()
  2. Fields #32
    1. cascading.tuple.Fields
    2. Provides storage for field metadata : names, types, comparators & type coercion
    3. ----- Example
    4. Fields people = new Fields("first_name", "last_name")
    5. ----- Useful Field sets
      1. Fields.ALL #34
        1. A wild card that represents all the current available fields
      2. Fields.UNKNOWN
      3. Fields.ARGS
      4. .... 
    6. Can be used as both 'declarators' and 'selectors' #34
  3. Data typing & coercion
    1. For implicit conversion of one type to another 
    2. ----- Example
      1.  pipe = new Coerce(new Fields("timestamp"), Long.class) 
      2.  Fields simple = new Fields ("age", Long.class); 
    3. ----- Methods
      1. TupleEntry.getString()

No comments:

Post a Comment