Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Big Data Hadoop & Spark by (120 points)

Input file:

(101,sweta,20,bbsr)

(102,praful,20,vgz)

(103,gita,40,hyd)

(104,lil,30,hyd)

(105,rama,30,bang)

(106,kunu,60,bbsr)

(107,pkn,60,bam)

grunt> emp_startswith = FOREACH Emp GENERATE (id,name),STARTSWITH(name,'p');
For the above function getting correct output pasted below
((101,sweta),false)
((102,praful),true)
((103,gita),false)
((104,lil),false)
((105,rama),false)
((106,kunu),false)
((107,pkn),true)
For ENDSWITH() getting error
grunt> emp_endswith = FOREACH Emp GENERATE (id,name),ENDSWITH(name,'a');
2020-03-25 17:26:41,637 [main] WARN  org.apache.hadoop.conf.Configuration - mapreduce.job.counters.limit is deprecated. Instead, use mapreduce.job.counters.max
2020-03-25 17:26:41,667 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve ENDSWITH using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Please suggest on the same.
Thanks,
Sweta
Please log in to answer this question.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...