avatar image
Former Member

udf help

Hi ,

I am checking one input as (00) than okay otherwise through exception using below UDF

public String check code (String var1, Container container) throw StreamTransformationException{

if (var1 != 00)

{

throw new RuntimeException("mapping fail");

}

else

{


return var1;

}

}

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 06, 2015 at 01:34 PM

    Hi Abhay,

    Try with the following code:

    public String check code (String var1, Container container) throw StreamTransformationException{

    if (!(var1.equals("00")))

    throw new StreamTransformationException("mapping fail - Expected value is 00");

    else

      return var1;

    }

    Regards,

    Azhar

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content