How do I delete one field without knowing at compile time what the
incoming fields are?
The example in the users guide presumes knowledge of the keep fields:
// incoming -> "keepField", "dropField"
pipe = new Each( pipe, new Fields( "keepField" ), new Identity(),
Fields.RESULTS );
// outgoing -> "keepField"
What I'm looking for is something like ...
pipe = new Delete( pipe, new Fields( "deleteMe" ) );
What I'm really looking for is a version of Rename that won't blow up
if the toField already exists. This is my current solution, which
works but sends junk data through the system until the next
Aggregation.
String junkFieldName = "IGNORE_FIELD_" + new
Date().getTime();
pipe = new Rename( pipe, new Fields( toFieldName ), new
Fields( junkFieldName) );
pipe = new Rename( pipe, new Fields( fromFieldName ), new
Fields( toFieldName) );
> How do I delete one field without knowing at compile time what the
> incoming fields are?
> The example in the users guide presumes knowledge of the keep fields:
> // incoming -> "keepField", "dropField"
> pipe = new Each( pipe, new Fields( "keepField" ), new Identity(),
> Fields.RESULTS );
> // outgoing -> "keepField"
> What I'm looking for is something like ...
> pipe = new Delete( pipe, new Fields( "deleteMe" ) );
> What I'm really looking for is a version of Rename that won't blow up
> if the toField already exists. This is my current solution, which
> works but sends junk data through the system until the next
> Aggregation.
> String junkFieldName = "IGNORE_FIELD_" + new
> Date().getTime();
> pipe = new Rename( pipe, new Fields( toFieldName ), new
> Fields( junkFieldName) );
> pipe = new Rename( pipe, new Fields( fromFieldName ), new
> Fields( toFieldName) );
> Thanks,
> Wallace
> -- > You received this message because you are subscribed to the Google Groups "cascading-user" group.
> To post to this group, send email to cascading-user@googlegroups.com.
> To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
Ack! I went looking in the javadocs for Discard, Delete, Dispose,
Remove ... and now notice that although I'm using 2.0 code, I was
searching 1.1 javadocs.
Thanks again!
Wallace
On Apr 26, 1:30 pm, Chris K Wensel <ch...@wensel.net> wrote:
> On Apr 26, 2012, at 1:19 PM, Wallace Mann wrote:
> > How do I delete one field without knowing at compile time what the
> > incoming fields are?
> > The example in the users guide presumes knowledge of the keep fields:
> > // incoming -> "keepField", "dropField"
> > pipe = new Each( pipe, new Fields( "keepField" ), new Identity(),
> > Fields.RESULTS );
> > // outgoing -> "keepField"
> > What I'm looking for is something like ...
> > pipe = new Delete( pipe, new Fields( "deleteMe" ) );
> > What I'm really looking for is a version of Rename that won't blow up
> > if the toField already exists. This is my current solution, which
> > works but sends junk data through the system until the next
> > Aggregation.
> > String junkFieldName = "IGNORE_FIELD_" + new
> > Date().getTime();
> > pipe = new Rename( pipe, new Fields( toFieldName ), new
> > Fields( junkFieldName) );
> > pipe = new Rename( pipe, new Fields( fromFieldName ), new
> > Fields( toFieldName) );
> > Thanks,
> > Wallace
> > --
> > You received this message because you are subscribed to the Google Groups "cascading-user" group.
> > To post to this group, send email to cascading-user@googlegroups.com.
> > To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/cascading-user?hl=en.