cancel
Showing results for 
Search instead for 
Did you mean: 

Sort with same context

venkatanarayana_vagu
Active Participant
0 Kudos

Hi all,

I facing an issue during the sorting task. Below is the queue. I want below values should be sorted along with the contexts. I am able to sort with SortByKey. But I am missing the context. Please any body have the UDF to get the context with sort?

Accepted Solutions (1)

Accepted Solutions (1)

venkatanarayana_vagu
Active Participant
0 Kudos

I have solved this by my self with simple UDF:

it should by all values of Queue


public void countContext(String[] var1, ResultList result, Container container) throws StreamTransformationException{

String temp = " ";

int j = 1;

for (int i=0; i<var1.length; i++)

{

if(!var1[i].equals(ResultList.CC))

  {

        temp = Integer.toString(j);

  result.addValue(temp);

// result.addContextChange();

  }

  else

  {

  // result.addValue(temp);

  result.addContextChange();

              j++;

  }

}

}

And my mapping as below:

Answers (0)