we can keep multiple functions
under one program(.py)
transoform.py
-------------------------
from pig_util import outputSchema
@outputSchema(name:Chararray)
def firstUpper(x):
fc = x[0].upper()
rc = x[1:].lower()
n = fc+rc
return n
@outputSchema(sex:Chararray)
def gender(x):
if x=='m':
x = 'Male'
else:
x = 'Female'
return x
@outputSchema(dname:chararray)
def dept(dno):
dname="Others"
if dno==11:
dname = 'Marketing'
elif dno==12:
dname="Hr"
elif dno==13:
dname="Finance"
return dname
-----------------
register 'transform.py' using jython
as myprog
res = foreach emp generate
id, myprog.firstUpper(name) as name,
sal , myprog.gender(sex) as sex,
myprog.dept(dno) as dname;
-------------------------------------
pig unions :
data1 = load 'file1' using PigStorage(',')
as (name:chararray, city:chararray);
data2 = load 'file2' using PigStorage(',')
as (name:chararray, sal:int);
d1 = foreach data1 generate
name, city, null as sal ;
d2 = foreach data2 generate
name, null as city, sal;
d = union d1, d2;
under one program(.py)
transoform.py
-------------------------
from pig_util import outputSchema
@outputSchema(name:Chararray)
def firstUpper(x):
fc = x[0].upper()
rc = x[1:].lower()
n = fc+rc
return n
@outputSchema(sex:Chararray)
def gender(x):
if x=='m':
x = 'Male'
else:
x = 'Female'
return x
@outputSchema(dname:chararray)
def dept(dno):
dname="Others"
if dno==11:
dname = 'Marketing'
elif dno==12:
dname="Hr"
elif dno==13:
dname="Finance"
return dname
-----------------
register 'transform.py' using jython
as myprog
res = foreach emp generate
id, myprog.firstUpper(name) as name,
sal , myprog.gender(sex) as sex,
myprog.dept(dno) as dname;
-------------------------------------
pig unions :
data1 = load 'file1' using PigStorage(',')
as (name:chararray, city:chararray);
data2 = load 'file2' using PigStorage(',')
as (name:chararray, sal:int);
d1 = foreach data1 generate
name, city, null as sal ;
d2 = foreach data2 generate
name, null as city, sal;
d = union d1, d2;
Excellent Article.. I learnt something new information about pig from this article.. thank you for sharing
ReplyDeletebig data training in chennai | big data training and placement
Thanks for sharing wonderfull content Big data Hadoop Online Training In Hyderabad
ReplyDeleteHi sir please provide block chain classes viedos
ReplyDeleteThanks for sharing the valuable information to share with us. For more information please visit our website. How To Find Hadoop Training In Hyderabad| CLICK HERE
ReplyDeleteI appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
ReplyDeleteClick here:
angularjs4 Training in Chennai
Click here:
angularjs5 Training in Chennai
Click here:
Selenium Training in Chennai
Click here:
Aws Training in Chennai
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteBlueprism training in Chennai
Blueprism training in Bangalore
Blueprism training in Pune
Blueprism online training
Blueprism training in tambaram
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteBlueprism training in Chennai
Blueprism training in Bangalore
Blueprism training in Pune
Blueprism online training
Blueprism training in tambaram
Very informative blog on Python specially for fresher. Love it.
ReplyDeletePython Training in Pune
Python Classes in Pune
Python Institutes in Pune
Python Training Institutes in Pune
Python Training in Pune
Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
ReplyDeletejava training in marathahalli | java training in btm layout
java training in jayanagar | java training in electronic city
Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
ReplyDeleteData Science course in Chennai | Data science course in bangalore
Data science course in pune | Data science online course
Data Science Interview questions and answers | Python course in Kalyan nagar
thank you for sharing such a nice and interesting blog with us. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating...
ReplyDeleteTesting Training in Chennai
Software Testing institutes in Chennai
Software Testing Training
Best Software Testing Training Institute in Chennai
Software Testing Training in Chennai
Awesome post, really helpful for all. Share more like this.
ReplyDeleteAngular 6 Training in Chennai
Angularjs Training center in Chennai
Angularjs Training in Chennai
AWS course in Chennai
RPA Training Institute in Chennai
Python classes in Chennai
This is really too useful and have more ideas and keep sharing many techniques. Eagerly waiting for your new blog keep doing more.
ReplyDeletecloud computing courses in bangalore
cloud computing certification in bangalore
Aws Certification Training in Bangalore
Aws Training Center in Bangalore
cloud computing classes in bangalore
best cloud computing training institutes in bangalore
I like it, very decent article. Thanks a lot Python Training in Pune
ReplyDeleteThis blog is more effective and it is very much useful for me.
ReplyDeletewe need more information please keep update more.
Salesforce Training in Saidapet
Salesforce Training in Ashok Nagar
Salesforce Training in Nolambur
Salesforce Training in Perambur
I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
ReplyDeleteRPA Training in Chennai
Robotics Process Automation Training in Chennai
RPA courses in Chennai
Robotic Process Automation Training
RPA course
Robotic Process Automation Certification
Very good blog, thanks for sharing such a wonderful blog with us.
ReplyDeleteData Science Course in Chennai
Data Science Training near me
AWS Certification in Chennai
Angularjs Training in Chennai
RPA Training in Chennai
DevOps Training in Chennai
Thanks to the admin of this blog for sharing these kinds of useful information; Have been waiting for more updates.
ReplyDeleteIELTS Classes in Mumbai
IELTS Coaching in Mumbai
Best IELTS Coaching in Mumbai
IELTS Center in Mumbai
IELTS Training in Mumbai
Best IELTS Classes in Mumbai
IELTS Class in Mumbai
Amazing Post. The content is very interesting. Waiting for your future updates.
ReplyDeleteXamarin Training in Chennai
Xamarin Course in Chennai
Xamarin Training
Xamarin Course
Primavera Training in Chennai
Primavera Course in Chennai
IELTS coaching in Chennai
IELTS Training in Chennai
You are doing a great job. I would like to appreciate your work for good accuracy.
ReplyDeleteBest Selenium Training Institute in Chennai | Selenium Course in Chennai
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteinformatica mdm online training
apache spark online training
apache spark online training
devops online training
aws online training
Resources like the one you mentioned here will be very useful to me ! I will post a link to this page on my blog. I am sure my visitors will find that very useful
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Python online training
uipath online training
Great Article. Good choice of words. Waiting for your future updates.
ReplyDeleteHadoop Admin Training in Chennai
Hadoop Administration Training in Chennai
Hadoop Administration Course in Chennai
Hadoop Administration Training
Hadoop Admin Training in Velachery
Hadoop Admin Training in T Nagar
Hadoop Admin Training in Tambaram
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well. Please keep up the good work.
ReplyDeletePython training in Kalyan nagar
nice posts. this could not be explained better. Thanks for sharing, Keep up the good work.
ReplyDeletedevops training in Bangalore
SalesForce developer Training in Bangalore
AWS training in Bangalorer
Data Analytics Training in Bangalore
Great Applause. The content you shared is very inspirational. Thanks for Posting.
ReplyDeleteBlockchain certification
Blockchain course
Blockchain courses in Chennai
Blockchain Training Chennai
Blockchain Training in Anna Nagar
Blockchain Training in T Nagar
Blockchain Training in OMR
Blockchain Training in Porur
I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
ReplyDeleteDevops Course Training in Chennai |Best Devops Training Institute in Chennai
Selenium Course Training in Chennai |Best Selenium Training Institute in Chennai
Java Course Training in Chennai | Best Java Training Institute in Chennai
ETLhive
ReplyDeletehttps://www.etlhive.com/
ETLHIVE is a leading advanced software training institute in Pune. We are known for Best Bigdata and Hadoop training in pune . Weekend & weekdays batch.
https://www.etlhive.com/best-bigdata-hadoop-training-institute-in-pune/
https://www.etlhive.com/course/data-science-training-pune-and-data-analytics-training-pune/
https://www.etlhive.com/selenium-training-in-pune/
https://www.etlhive.com/informatica-training-institutes-in-pune/
https://www.etlhive.com/amazon-aws-training-in-pune/
https://etlhive.com/angularjs-training-in-pune/
This information you provided in the blog that is really unique I love it!!
ReplyDeletePython Training in Gurgaon
Python Course in Gurgaon
The Blog is really amazing. every Blog should be explained very neat and unique in the manner.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
Your articles really impressed for me,because of all information so nice. nice page to see.
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteJava training in Chennai
Java Online training in Chennai
Java Course in Chennai
Best JAVA Training Institutes in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Training
Java Online Training
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...data science courses
ReplyDeleteNice Blog. I have gather more information about here.
ReplyDeletePython Online Training
Python Online Training in Chennai
Python Online Course in Chennai
Start your journey into Python programming by registering for the challenging Python Course in Hyderabad program by AI Patasala.
ReplyDeleteOnline Python Course in Hyderabad
Attend the data Science Courses from AI Patasala. Practical data science Courses Sessions with Assured Placement Support from Experienced Faculty. AI Patasala Offers the Data Science Courses.
ReplyDeleteData Science Course Institute in Hyderabad