I am having an input file with date as one of the columns. while loading data i mentioned it is chararray. I want to change this into date format using ToDate(userstring, format) function . My date is in dd/mm/yyyy format. Script is as below,
mydata = load '/testinput' using PigStorage(';') as (pdate:chararray, time:chararray, gpower:double, sm1: double, sm2:double, sm3:double);
getdate = foreach mydata generate ToDate(pdate, 'dd/mm/yyyy'), time, gpower, sm1, sm2, sm3;
This is giving me error with error code 1066.
Can anybody please help me to get the issue resolved.