What is Funnel Stage in Data Stage?
The Funnel stage is an active stage used to combine multiple input data streams into a single output stream.
It appends rows vertically (row-wise combination), not column-wise.
1️. Basic Funnel Stage Diagram
Input 1 (File / Table A)
|
v
+-----------+
Input 2 ->| FUNNEL |----> Single Output
+-----------+
^
|
Input 3
Explanation
· Multiple input links
· One output link
· All rows are combined into one flow
2️. Funnel Stage Row-Wise Example
Input Data
Input 1
ID NAME
1 A
2 B
Input 2
ID NAME
3 C
4 D
Funnel Output :
ID NAME
1 A
2 B
3 C
4 D
Rows are appended, not joined
3️.Funnel Stage in Parallel Processing
Input Links
-------------------------
| | |
In1 In2 In3
| | |
+------+ +------+ +------+
|FUNNEL| |FUNNEL| |FUNNEL|
+------+ +------+ +------+
| | |
-------------------------
|
Single Output
Explanation
- Funnel works in parallel
- Each input contributes rows
- Output is one combined stream
4️. Funnel vs Join .
FUNNEL (Append Rows)
-------------------
Input1: 1 A
Input2: 1 B
Output : 1 A 1 B
JOIN (Combine Columns)
---------------------
Input1: 1 A
Input2: 1 B
Output : 1 A B
✔
Funnel = UNION ALL
✔ Join = JOIN
5️.Funnel vs Union Stage
Multiple Inputs
|
v
FUNNEL STAGE (Older, flexible)
UNION STAGE (Newer, simpler)
|
Funnel |
Union |
|
||
|
Available in older versions |
Introduced later |
|
||
|
Supports many inputs |
Cleaner design |
|
||
|
Schema must match |
Schema must match |
|
||
Functionally similar
6️. Common Funnel Use Case (Real-Time)
Scenario: Combine Daily Files
File_A
|
File_B ----> FUNNEL ----> Target Table
|
File_C
✔ All records loaded into one target
7️.Funnel with Reject Link
Input 1
|
Input 2 ---> FUNNEL ---> Output
|
Input 3
|
v
Reject
✔ Rejects rows with schema issues
8️.Funnel vs Sort vs Merge :
FUNNEL → Appends rows
SORT → Orders rows
MERGE → Combines sorted streams
All input links must have IDENTICAL metadata, including:
-
Column names
-
Column order
-
Data types (int, varchar, decimal, date, etc.)
-
Length / precision / scale
-
Nullability
-
Key position (if defined)
If any one input link’s metadata changes, the Funnel stage fails at compile time (or sometimes at runtime).
No comments:
Post a Comment