Posts

Showing posts with the label ETL Processing

S) Normalise scenario --> Input: 1,a,b,c,2,d,e,f,g

 Input: 1,a,b,c,2,d,e,f,g   Output: field1 field2 1       a 1       b 1       c 2       d 2       e 2       f 2       g     input---->normalize--->output   type temporary_type =  record   decimal("") v_col1;   decimal("") v_col2; end; out::length(in) = begin   out :: length_of(string_split(in.col, ",")); end; temp::normalize(temp, in, index) = begin   temp.v_col1 :: if (string_is_numeric(string_split(in.col, ",")[index])==1)                      string_split(in.col, ",")[index] else temp.v_col1;   temp.v_col2 :: string_split(in.col, ",")[index]; end; temp::initialize(in) = begin   temp.v_col1 :: 0;   temp.v_col2 :: 0; end; out::finalize(temp, in) = begin   out.col1 :: temp.v_col1;   out.col2 :: temp.v_col2; end; ...

T) Explain the Run time Behaviour of Reformat Component ?

The Reformat component processes your data records through these steps: Basic Setup: Each output port is numbered (out0, out1, out2, etc.) Each output has matching reject and error ports (reject0/error0, reject1/error1, etc.) Step-by-Step Process: Read a Record Takes one record from the input port Check Selection Filter (if you have one) If the filter expression returns FALSE : Record is skipped, go to next record If the filter returns NULL : Graph stops with an error message If the filter returns TRUE (or no filter exists): Continue processing Determine Where to Send the Record If you have only one output port : Record goes to that port automatically If you have multiple output ports : Uses output-index to decide which port(s) get this record Can send to one port or multiple ports If there's an error choosing ports, record goes to reject0 Transform the Record For each designated output port: If no transform is defined: Uses automatic field mapping If transform is defined: Runs ...

T) What is Single Stage and Multi stage component ?

  Single stage components process each record in a single step.Below are example of single stage component.  Filter by expression  Reformat  Dedup    Multi stage components process records in multiple stages allowing more complex operations like  initialisation,  finalization   Below are the example of the multi stage components    Normalize  Rollup  Scan  Scan with rollup etc.

S) Ball & run Scenario | Type 2

Image
      Input data       over run   1 6   2 5   3 13           Rollup    Use key change function   type temporary_type =   record   decimal("\n ") run _per_over ;   end;   out:: key_change (in 1,in 2)=   begin   out:: if(( decimal( "|" ))in2.ball %6==1)1 else 0;   end;   temp:: initialize(in)=   begin   temp.run_per_ over : :0;   end;   temp ::rollup ( temp,in )=   begin   temp.run_per_ over :: temp.run _per_over +( decimal( "|")) in.run ;   end;   out : : finalize( temp, in) =   begin   out.over ::( decimal("|")) next_in_sequence ();   out.run :: temp.run _per_over ;   end;      

S) Ball & run Scenario using rollup -- Type 1

Image
  Input data         o/p   ball run   1 6   2 5   3 5         Rollup   Use key change function