Input polymorphism
Tuesday, March 01, 2011
8:36 AM
One function argument: Tuple input
Varying Tuple size. 
Tuple elements can be accessed by number n:
Object thing = input.get(n);
Tuple element iterators access variable-size tuples:
for (Iterator<Tuple> it = input.iterator();
it.hasNext();) {
Object thing = it.next();
// do something with thing, 
// which is type-polymorphic
}
Access hidden type information via instanceof
If (thing instanceof sometype) { 
Sometype foo = (sometype) thing; 
// do something with foo
} 
Only types that can arise in input are Pig equivalents!