Thursday, April 3, 2014

Target table rows , with each row as sum of all previous rows from source table.

Target table rows , with each row as sum of all previous rows from source table.

AddThis Social Bookmark Button
Scenario: How to produce rows in target table with every row  as sum of all previous rows in source table ? See the source and target table to understand the scenario.
 
SOURCE TABLE
id Sal
1 200
2 300
3 500
4 560
TARGET TABLE
Id Sal
1 200
2 500
3 1000
4 1560
  1. Pull the source to mapping and then connect it to expression.
  2. In expression add one column and make it output(sal1) and sal port as input only.
    We will make use of a function named cume() to solve our problem, rather using any complex mapping.  Write the expression in sal1 as cume(sal) and send the output rows to target.

No comments:

Post a Comment

Data engineering Interview Questions

1)  What all challenges you have faced and how did you overcome from it? Ans:- Challenges Faced and Overcome As a hypothetical Spark develop...