on 2014 Jun 04 4:55 PM
1. Source has some 1 lakh records , have to load to 2 different tables in target equally 50% each, there are no condition, Just each table should be loaded with 50% records?
Thanks
Madhu
Hello
Firstly, the title of your question really isn't helpful.
Right, on with your interview question - use a query to add a number column populated using gen_row_num. Next, use a case transform to direct odd numbers down one route and even another, this can be done using the mod function.
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
I don't know if you're right or wrong (although you did spell my name incorrectly).
You could replace the case with 2 query transforms, but I doubt that would have any performance benefit in this example unless the source was a table (it isn't specified) and had a column that could be used to partition the data. In which case, the use of the query tranform might allow push-down of the partition logic, or even the whole dataflow.
My solution would work for any source.
Michael
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.