Page 1 of 1

Diff between Filter and Switch Stages

Posted: Mon Apr 24, 2006 12:03 am
by swetha007
Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.

Posted: Mon Apr 24, 2006 12:55 am
by ray.wurlod
Welcome aboard. :D

This sounds suspiciously like an interview question. A short answer is that one uses a value to make its decision, the other can use a expression that is somewhat like an SQL WHERE clause.

Performance is not the issue; it's functionality. You choose the right stage for the job.

Read the appropriate chapters in the Parallel Job Developer's Guide or invoke on-line help to learn more.

Posted: Mon Apr 24, 2006 1:13 am
by koolnitz
As mentioned by Ray, Filter is like WHERE clause in your SQL while Switch is analogous to Switch in 'C' language, where you set cases.
Switch supports atmost 128 output links while Filter supports any no. of output links (atleast in theory). Both the stages can have an optional Reject link.

Posted: Mon Apr 24, 2006 11:18 am
by bcarlson
The only thing to keep in mind with the Switch stage is that the parameter used for decision making must be integer (or char, which in C is 'equivalent'). That means no string, no decimals, no dates, etc.

The switch is useful, don't get me wrong. But it does have limitations that Filter does not have.

Brad.

Re: Diff between Filter and Switch Stages

Posted: Mon Apr 24, 2006 9:50 pm
by vijayrc
swetha007 wrote:Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.
Well SWITCH is like your CASE statement in C or an EVALUATE statement in COBOL wherein when the condition is met, exit is taken.

FILTER is used to drive an input to many different streams/path.

Re: Diff between Filter and Switch Stages

Posted: Thu May 04, 2006 9:32 am
by rony_daniel
vijayrc wrote:
swetha007 wrote:Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.
Well SWITCH is like your CASE statement in C or an EVALUATE statement in COBOL wherein when the condition is met, exit is taken.

FILTER is used to drive an input to many different streams/path.
Well Vijay i guess what you said for FILTER is applicable to SWITCH as well. But SWITCH does not necessarily exit out like a CASE statement. If you set to discard or drop the records which does not meet the conditions then you are getting different output streams for SWITCH also.

Posted: Thu May 04, 2006 2:25 pm
by ray.wurlod
:twisted: I wonder what the "correct" answer (the one sought by the interviewer) is?