Reputation: 6084
I am trying to convert a string to upper case in pig using one of it's built-in functions. I am using pig in local mode.
1,John,35,M,101,50000.00,03/03/79
2,Jack,30,F,201,3540000.00,09/10/84
empdata = load 'emps.csv' using PigStorage(',') as (id:int,name:chararray,age:int,gender:chararray,deptId:int,sal:double);
dump empdata
empnameucase = foreach empdata generate id,upper(name);
But I am getting following exception after executing above command:
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve upper using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:653)
at org.apache.pig.impl.PigContext.getClassForAlias(PigContext.java:769)
at org.apache.pig.parser.LogicalPlanBuilder.buildUDF(LogicalPlanBuilder.java:1491)
... 28 more
Please guide.
Upvotes: 0
Views: 1132
Reputation: 1043
Try this, You should specify the function name in UPPER case like
UPPER(name)
Hopt,it should work.
Upvotes: 1