on 07-03-2020 2:30 PM
its very simple code...with queue context
int i=ProductID.length;
result.addValue(ProductID[i-1]);
it works thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sakriyanaik.nk,
The code of rajeshps will work perfectly fine. Just use remove context for the input field (String[] personNum) before calling the UDF in mapping.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
This works - small change require in code in output we are getting below.
10,
10,20,
10,20,30,
10,20,30,40, and so on.
----
in the above scenario - we need to process last line i:e 10,20,30,40 and so on remaining above ignore.
-----
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello sakriyanaik.nk,
You can use below UDF to add commas after each context.
public void addComma(String[] personNum, ResultList result, Container container) throws StreamTransformationException{
String target="";
for(int i = 0;i<personNum.length;i++)
{
target = target+personNum[i];
if (i != personNum.length-1)
{
// if i not equal to personNum.length -1
target = target+"," ;
}
result.addValue(target);
}
Thanks,
Rajesh PS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.