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;
 

 

 

Comments

Popular posts from this blog

T) For data parallelism, we can use partition components. For component parallelism, we can use replicate component. Like this which component(s) can we use for pipeline parallelism?

T) When to use sort within groups ?

T) Explain about on .abi-unc files in abinitio ?