on 03-02-2016 11:27 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narendran,
You can use below UDF, you need to download jodatime library from this url Maven Repository: joda-time » joda-time » 1.6 and import it as imported archive and add it to mapping under Archives Used tab.
public String getAge(String name, String time, Container container) throws StreamTransformationException {
LocalDate birthdate = new LocalDate((long) Double.parseDouble(time));
LocalDate now = new LocalDate();
Period period = new Period(birthdate, now, PeriodType.yearMonthDayTime());
return name + " is " + period.getYears() + " years old and " + period.getMonths() + " months and " + period.getDays()
+ " days and " + period.getHours() + " hours";
}
Regards,
Praveen.
Hi Narendran,
You can do it an UDF as well using a pattern as this thread shows http://stackoverflow.com/questions/12636102/how-to-find-string-pattern-in-java
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narendran,
Could you please paste your source and target data types?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.