Dynamic Column Creating Functions?

28 views
Skip to first unread message

Eric Y. Theriault

unread,
May 19, 2013, 2:51:33 PM5/19/13
to cascadi...@googlegroups.com
Hi--



I'm trying to create a Pivot-like function in which the stream accepts a set of tuples and introduces new column names based on the input tuples.  Effectively, I'm creating my own data structure based on the operate() input and when a flush() is invoked, it creates the necessary tuples and flows them through the OutputCollector.

Because it is dependent on the data, I don't have the tuple names upfront, so I can't initialize the fieldDeclarations properly in the constructor or the prepare() method.  The Fields.UNKNOWN allows my function to work, except that the header field is lost.  How can I get that header line in there?  Is this even the best way to do this?  Thanks for any pointers.



eyt*

Chris K Wensel

unread,
May 19, 2013, 7:33:00 PM5/19/13
to cascadi...@googlegroups.com
There is no way to create field names on the fly after the planner has been invoked. this is by design.

ckw

--
You received this message because you are subscribed to the Google Groups "cascading-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascading-use...@googlegroups.com.
To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Eric Y. Theriault

unread,
May 19, 2013, 11:30:42 PM5/19/13
to cascadi...@googlegroups.com
Looking through the code, I was starting to think that.  I'll see if perhaps there's some workaround we can do here.

If any "workarounds" or alternative algorithms come to mind, please let me know.  Thanks for a great product :).



eyt*
Reply all
Reply to author
Forward
0 new messages