Data science Software Course Training in Ameerpet Hyderabad

Data science Software Course Training in Ameerpet Hyderabad

Wednesday 17 May 2017

Pig : Udfs using Python

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;




37 comments:

  1. Excellent Article.. I learnt something new information about pig from this article.. thank you for sharing

    big data training in chennai | big data training and placement

    ReplyDelete
  2. Hi sir please provide block chain classes viedos

    ReplyDelete
  3. Thanks 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

    ReplyDelete
  4. I 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.
    Click here:
    angularjs4 Training in Chennai
    Click here:
    angularjs5 Training in Chennai
    Click here:
    Selenium Training in Chennai
    Click here:
    Aws Training in Chennai

    ReplyDelete
  5. 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. 
    Blueprism training in Chennai

    Blueprism training in Bangalore

    Blueprism training in Pune

    Blueprism online training

    Blueprism training in tambaram

    ReplyDelete
  6. 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. 
    Blueprism training in Chennai

    Blueprism training in Bangalore

    Blueprism training in Pune

    Blueprism online training

    Blueprism training in tambaram

    ReplyDelete
  7. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.

    java training in marathahalli | java training in btm layout

    java training in jayanagar | java training in electronic city

    ReplyDelete
  8. 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...
    Testing Training in Chennai
    Software Testing institutes in Chennai
    Software Testing Training
    Best Software Testing Training Institute in Chennai
    Software Testing Training in Chennai

    ReplyDelete
  9. I am happy to find this post Very useful for me, as it contains lot of information

    bloggydirectory
    Article submission sites

    ReplyDelete
  10. I like it, very decent article. Thanks a lot Python Training in Pune

    ReplyDelete
  11. 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.
    RPA Training in Chennai
    Robotics Process Automation Training in Chennai
    RPA courses in Chennai
    Robotic Process Automation Training
    RPA course
    Robotic Process Automation Certification

    ReplyDelete
  12. You are doing a great job. I would like to appreciate your work for good accuracy.
    Best Selenium Training Institute in Chennai | Selenium Course in Chennai

    ReplyDelete
  13. 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.

    informatica mdm online training

    apache spark online training

    apache spark online training

    devops online training

    aws online training

    ReplyDelete
  14. 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
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

    ReplyDelete
  15. 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.

    Python training in Kalyan nagar

    ReplyDelete
  16. ETLhive
    https://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/

    ReplyDelete
  17. This information you provided in the blog that is really unique I love it!!
    Python Training in Gurgaon
    Python Course in Gurgaon

    ReplyDelete
  18. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...data science courses

    ReplyDelete
  19. Start your journey into Python programming by registering for the challenging Python Course in Hyderabad program by AI Patasala.
    Online Python Course in Hyderabad

    ReplyDelete
  20. 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.
    Data Science Course Institute in Hyderabad

    ReplyDelete