SlideShare uma empresa Scribd logo
1 de 11
Apache Pig
아꿈사
박민규
Talking Pig
Pig Latin
Data Flow
Hive
Pig Dev Philosophy
Pigs Eat Anything.
Pigs Live Anywhere.
Pigs Are Domestic Animals.
Pigs Fly.
http://pig.apache.org/philosophy.html
Data Type
Name Description Example
Scalar int Signed 32-bit integer 10
long Signed 64-bit integer 10L
float 32-bit floating point 10.5F
double 64-bit floating point 10.5
Arrays chararray Character array (string)
in Unicode UTF-8 format
Hello World
bytearray Byte array (blog)
Complex tuple An ordered set of fields. (19,2)
bag An collection of tuples. {(19,2), (18, 1)}
map A set of key value pairs. [open#apache]
Key is chararray.
Key is unique.
Value is any type.
Run local
pix -x local
grunt> a = LOAD '/etc/passwd' USING PigStorage(':');
grunt> DUMP a;
grunt> EXPLAIN a;
grunt> b = FOREACH a GENERATE $0 as id;
grunt> DUMP b;
grunt> EXPLAIN b;
grunt> c = FOREACH a GENERATE $1 as id;
grunt> DUMP c;
grunt> EXPLAIN c;
grunt> STORE b INTO ‘id.out’;
Word Count
pix -x local
grunt> a = LOAD './input.txt';
grunt> b = FOREACH a GENERATE FLATTEN(TOKENIZE((CHARARRAY)
$0)) AS word;
grunt> c = GROUP b by word;
grunt> d = FOREACH c GENERATE COUNT(b), GROUP;
grunt> e = ORDER d BY $0;
grunt> STORE e INTO './wordcount';
Schema
pix -x local
grunt> records = LOAD ‘sample.txt’ AS(year:int,
temperature:int, quality:int);
grunt> filtered_records = FILTER records BY temperature !=
9999 AND (quality == 0 OR quality == 1 OR quality == 4 OR
quality == 5 OR quality == 9);
grunt> grouped_records = GROUP filtered_records BY year;
grunt> max_temp = FOREACH grouped_records GENERATE GROUP,
MAX(filterd_records.temperature);
grunt> DUMP max_temp;
grunt> ILLUSTRATE max_temp;
Functions
Eval
– avg, concat, count, count_star, diff, max, min,
size,sum, tokenize
Filter
– IsEmpty
Load/Store
– PigStroage, BinStorage, TextLoader, PigDump
UDFs
Extends EvalFunc, FilterFunc, LoadFunc
Override
Make jar
grunt> REGISTER pig-examples.jar;
grunt> filtered = FILTER records BY temperature != 9999 AND
com.hadoop.pig.IsGoodQuality(quality);
grunt> DEFINE isGood com.hadoopbook.pig.IsGoodQuality();
Keywords
and, any, all, arrange, as, asc, AVG
bag, BinStorage, by, bytearray
cache, cat, cd, chararray, cogroup, CONCAT, copyFromLocal, copyToLocal, COUNT, cp, cross
%declare, %default, define, desc, describe, DIFF, distinct, double, du, dump
e, E, eval, exec, explain
f, F, filter, flatten, float, foreach, full
generate, group
help
if, illustrate, inner, input, int, into, is
join
kill
l, L, left, limit, load, long, ls
map, matches, MAX, MIN, mkdir, mv
not, null
or, order, outer, output
parallel, pig, PigDump, PigStorage, pwd
quit
register, right, rm, rmf, run
sample, set, ship, SIZE, split, stderr, stdin, stdout, store, stream, SUM
TextLoader, TOKENIZE, through, tuple
union, using
= = != < > <= >= + - * / % ? $ . # :: ( ) [ ] { }
Thanx

Mais conteúdo relacionado

Mais procurados

Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingvibrantuser
 
Practical pig
Practical pigPractical pig
Practical pigtrihug
 
Cis 216 – shell scripting
Cis 216 – shell scriptingCis 216 – shell scripting
Cis 216 – shell scriptingDan Morrill
 
Session 02 python basics
Session 02 python basicsSession 02 python basics
Session 02 python basicsbodaceacat
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4Techvilla
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
 
DevOpsCon 2021: Go Web Development 101
DevOpsCon 2021: Go Web Development 101DevOpsCon 2021: Go Web Development 101
DevOpsCon 2021: Go Web Development 101Jan Stamer
 
entwickler.de Go Day: Go Web Development 101
entwickler.de Go Day: Go Web Development 101entwickler.de Go Day: Go Web Development 101
entwickler.de Go Day: Go Web Development 101Jan Stamer
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In PythonMarwan Osman
 
COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?Lloyd Huang
 
betterCode() Go: Einstieg in Go, Standard-Library und Ökosystem
betterCode() Go: Einstieg in Go, Standard-Library und ÖkosystembetterCode() Go: Einstieg in Go, Standard-Library und Ökosystem
betterCode() Go: Einstieg in Go, Standard-Library und ÖkosystemJan Stamer
 
R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたTakeshi Arabiki
 
Linux shell env
Linux shell envLinux shell env
Linux shell envRahul Pola
 

Mais procurados (20)

Bash production guide
Bash production guideBash production guide
Bash production guide
 
Pig workshop
Pig workshopPig workshop
Pig workshop
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
 
Rar
RarRar
Rar
 
Practical pig
Practical pigPractical pig
Practical pig
 
Cis 216 – shell scripting
Cis 216 – shell scriptingCis 216 – shell scripting
Cis 216 – shell scripting
 
Session 02 python basics
Session 02 python basicsSession 02 python basics
Session 02 python basics
 
Topic
TopicTopic
Topic
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
DevOpsCon 2021: Go Web Development 101
DevOpsCon 2021: Go Web Development 101DevOpsCon 2021: Go Web Development 101
DevOpsCon 2021: Go Web Development 101
 
entwickler.de Go Day: Go Web Development 101
entwickler.de Go Day: Go Web Development 101entwickler.de Go Day: Go Web Development 101
entwickler.de Go Day: Go Web Development 101
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
 
COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?
 
betterCode() Go: Einstieg in Go, Standard-Library und Ökosystem
betterCode() Go: Einstieg in Go, Standard-Library und ÖkosystembetterCode() Go: Einstieg in Go, Standard-Library und Ökosystem
betterCode() Go: Einstieg in Go, Standard-Library und Ökosystem
 
Sp ch05
Sp ch05Sp ch05
Sp ch05
 
R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみた
 
Linux shell env
Linux shell envLinux shell env
Linux shell env
 
Unix cheatsheet
Unix cheatsheetUnix cheatsheet
Unix cheatsheet
 

Destaque

HTTP 완벽가이드- 19장 배포시스템
HTTP 완벽가이드- 19장 배포시스템HTTP 완벽가이드- 19장 배포시스템
HTTP 완벽가이드- 19장 배포시스템박 민규
 
HTTP 완벽가이드- 18 웹 호스팅
HTTP 완벽가이드- 18 웹 호스팅HTTP 완벽가이드- 18 웹 호스팅
HTTP 완벽가이드- 18 웹 호스팅박 민규
 
HTTP 완벽가이드- 12 기본 인증
HTTP 완벽가이드- 12 기본 인증HTTP 완벽가이드- 12 기본 인증
HTTP 완벽가이드- 12 기본 인증박 민규
 
HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시박 민규
 
함수형사고 4장 열심히보다는현명하게
함수형사고 4장 열심히보다는현명하게함수형사고 4장 열심히보다는현명하게
함수형사고 4장 열심히보다는현명하게박 민규
 
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2박 민규
 
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키박 민규
 
실무로 배우는 시스템 성능 최적화
실무로 배우는 시스템 성능 최적화실무로 배우는 시스템 성능 최적화
실무로 배우는 시스템 성능 최적화박 민규
 
HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증박 민규
 
HTTP 완벽가이드 4장 커넥션관리
HTTP 완벽가이드 4장 커넥션관리HTTP 완벽가이드 4장 커넥션관리
HTTP 완벽가이드 4장 커넥션관리박 민규
 
Price floors and ceilings
Price floors and ceilingsPrice floors and ceilings
Price floors and ceilingsTravis Klein
 
ISAC constitution
ISAC constitution ISAC constitution
ISAC constitution Anuj Ramaiya
 
Kleptomaniac Press Release by EIN PRESSWIRE
Kleptomaniac Press Release by EIN PRESSWIREKleptomaniac Press Release by EIN PRESSWIRE
Kleptomaniac Press Release by EIN PRESSWIREDr. Frank Chase Jr
 
Flash Implications in Enterprise Storage Array Designs
Flash Implications in Enterprise Storage Array DesignsFlash Implications in Enterprise Storage Array Designs
Flash Implications in Enterprise Storage Array DesignsEMC
 
International trade
International tradeInternational trade
International tradeTravis Klein
 
Fri obama stimulus
Fri obama stimulusFri obama stimulus
Fri obama stimulusTravis Klein
 
RSA Cybercrime Statistics : November 2013
RSA Cybercrime Statistics : November 2013RSA Cybercrime Statistics : November 2013
RSA Cybercrime Statistics : November 2013EMC
 

Destaque (20)

HTTP 완벽가이드- 19장 배포시스템
HTTP 완벽가이드- 19장 배포시스템HTTP 완벽가이드- 19장 배포시스템
HTTP 완벽가이드- 19장 배포시스템
 
HTTP 완벽가이드- 18 웹 호스팅
HTTP 완벽가이드- 18 웹 호스팅HTTP 완벽가이드- 18 웹 호스팅
HTTP 완벽가이드- 18 웹 호스팅
 
HTTP 완벽가이드- 12 기본 인증
HTTP 완벽가이드- 12 기본 인증HTTP 완벽가이드- 12 기본 인증
HTTP 완벽가이드- 12 기본 인증
 
HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시
 
함수형사고 4장 열심히보다는현명하게
함수형사고 4장 열심히보다는현명하게함수형사고 4장 열심히보다는현명하게
함수형사고 4장 열심히보다는현명하게
 
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2
실무로 배우는 시스템 성능 최적화 - 프로세스의 메모리 구조 2
 
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키
HTTP 완벽가이드 10장 http2.0, 11장_클라이언트식별과쿠키
 
실무로 배우는 시스템 성능 최적화
실무로 배우는 시스템 성능 최적화실무로 배우는 시스템 성능 최적화
실무로 배우는 시스템 성능 최적화
 
HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증
 
HTTP 완벽가이드 4장 커넥션관리
HTTP 완벽가이드 4장 커넥션관리HTTP 완벽가이드 4장 커넥션관리
HTTP 완벽가이드 4장 커넥션관리
 
Price floors and ceilings
Price floors and ceilingsPrice floors and ceilings
Price floors and ceilings
 
ISAC constitution
ISAC constitution ISAC constitution
ISAC constitution
 
Kleptomaniac Press Release by EIN PRESSWIRE
Kleptomaniac Press Release by EIN PRESSWIREKleptomaniac Press Release by EIN PRESSWIRE
Kleptomaniac Press Release by EIN PRESSWIRE
 
Day 3 mon world
Day 3 mon worldDay 3 mon world
Day 3 mon world
 
Flash Implications in Enterprise Storage Array Designs
Flash Implications in Enterprise Storage Array DesignsFlash Implications in Enterprise Storage Array Designs
Flash Implications in Enterprise Storage Array Designs
 
International trade
International tradeInternational trade
International trade
 
Fri rights of man
Fri rights of manFri rights of man
Fri rights of man
 
Fri obama stimulus
Fri obama stimulusFri obama stimulus
Fri obama stimulus
 
Forex graphs
Forex graphsForex graphs
Forex graphs
 
RSA Cybercrime Statistics : November 2013
RSA Cybercrime Statistics : November 2013RSA Cybercrime Statistics : November 2013
RSA Cybercrime Statistics : November 2013
 

Semelhante a Pig

PigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxPigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxRahul Borate
 
power point presentation on pig -hadoop framework
power point presentation on pig -hadoop frameworkpower point presentation on pig -hadoop framework
power point presentation on pig -hadoop frameworkbhargavi804095
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of RubyTom Crinson
 
Pig Introduction to Pig
Pig Introduction to PigPig Introduction to Pig
Pig Introduction to PigChris Wilkes
 
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonAhmed Salama
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shellsascha_klein
 
Game unleashedjavascript
Game unleashedjavascriptGame unleashedjavascript
Game unleashedjavascriptReece Carlson
 
FParsec Hands On - F#unctional Londoners 2014
FParsec Hands On -  F#unctional Londoners 2014FParsec Hands On -  F#unctional Londoners 2014
FParsec Hands On - F#unctional Londoners 2014Phillip Trelford
 
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, Italy
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPHP data structures (and the impact of php 7 on them), phpDay Verona 2015, Italy
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPatrick Allaert
 
Getting modern with logging via log4perl
Getting modern with logging via log4perlGetting modern with logging via log4perl
Getting modern with logging via log4perlDean Hamstead
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsPierre MARTIN
 

Semelhante a Pig (20)

Apache pig
Apache pigApache pig
Apache pig
 
PigHive.pptx
PigHive.pptxPigHive.pptx
PigHive.pptx
 
PigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxPigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptx
 
PigHive.pptx
PigHive.pptxPigHive.pptx
PigHive.pptx
 
power point presentation on pig -hadoop framework
power point presentation on pig -hadoop frameworkpower point presentation on pig -hadoop framework
power point presentation on pig -hadoop framework
 
Hadoop pig
Hadoop pigHadoop pig
Hadoop pig
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
 
Pig Introduction to Pig
Pig Introduction to PigPig Introduction to Pig
Pig Introduction to Pig
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Pig & Pig Latin | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Rakudo
RakudoRakudo
Rakudo
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Game unleashedjavascript
Game unleashedjavascriptGame unleashedjavascript
Game unleashedjavascript
 
FParsec Hands On - F#unctional Londoners 2014
FParsec Hands On -  F#unctional Londoners 2014FParsec Hands On -  F#unctional Londoners 2014
FParsec Hands On - F#unctional Londoners 2014
 
Apache PIG
Apache PIGApache PIG
Apache PIG
 
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, Italy
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPHP data structures (and the impact of php 7 on them), phpDay Verona 2015, Italy
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, Italy
 
Getting modern with logging via log4perl
Getting modern with logging via log4perlGetting modern with logging via log4perl
Getting modern with logging via log4perl
 
November 2014 HUG: Apache Pig 0.14
November 2014 HUG: Apache Pig 0.14 November 2014 HUG: Apache Pig 0.14
November 2014 HUG: Apache Pig 0.14
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Pig

  • 3. Pig Dev Philosophy Pigs Eat Anything. Pigs Live Anywhere. Pigs Are Domestic Animals. Pigs Fly. http://pig.apache.org/philosophy.html
  • 4. Data Type Name Description Example Scalar int Signed 32-bit integer 10 long Signed 64-bit integer 10L float 32-bit floating point 10.5F double 64-bit floating point 10.5 Arrays chararray Character array (string) in Unicode UTF-8 format Hello World bytearray Byte array (blog) Complex tuple An ordered set of fields. (19,2) bag An collection of tuples. {(19,2), (18, 1)} map A set of key value pairs. [open#apache] Key is chararray. Key is unique. Value is any type.
  • 5. Run local pix -x local grunt> a = LOAD '/etc/passwd' USING PigStorage(':'); grunt> DUMP a; grunt> EXPLAIN a; grunt> b = FOREACH a GENERATE $0 as id; grunt> DUMP b; grunt> EXPLAIN b; grunt> c = FOREACH a GENERATE $1 as id; grunt> DUMP c; grunt> EXPLAIN c; grunt> STORE b INTO ‘id.out’;
  • 6. Word Count pix -x local grunt> a = LOAD './input.txt'; grunt> b = FOREACH a GENERATE FLATTEN(TOKENIZE((CHARARRAY) $0)) AS word; grunt> c = GROUP b by word; grunt> d = FOREACH c GENERATE COUNT(b), GROUP; grunt> e = ORDER d BY $0; grunt> STORE e INTO './wordcount';
  • 7. Schema pix -x local grunt> records = LOAD ‘sample.txt’ AS(year:int, temperature:int, quality:int); grunt> filtered_records = FILTER records BY temperature != 9999 AND (quality == 0 OR quality == 1 OR quality == 4 OR quality == 5 OR quality == 9); grunt> grouped_records = GROUP filtered_records BY year; grunt> max_temp = FOREACH grouped_records GENERATE GROUP, MAX(filterd_records.temperature); grunt> DUMP max_temp; grunt> ILLUSTRATE max_temp;
  • 8. Functions Eval – avg, concat, count, count_star, diff, max, min, size,sum, tokenize Filter – IsEmpty Load/Store – PigStroage, BinStorage, TextLoader, PigDump
  • 9. UDFs Extends EvalFunc, FilterFunc, LoadFunc Override Make jar grunt> REGISTER pig-examples.jar; grunt> filtered = FILTER records BY temperature != 9999 AND com.hadoop.pig.IsGoodQuality(quality); grunt> DEFINE isGood com.hadoopbook.pig.IsGoodQuality();
  • 10. Keywords and, any, all, arrange, as, asc, AVG bag, BinStorage, by, bytearray cache, cat, cd, chararray, cogroup, CONCAT, copyFromLocal, copyToLocal, COUNT, cp, cross %declare, %default, define, desc, describe, DIFF, distinct, double, du, dump e, E, eval, exec, explain f, F, filter, flatten, float, foreach, full generate, group help if, illustrate, inner, input, int, into, is join kill l, L, left, limit, load, long, ls map, matches, MAX, MIN, mkdir, mv not, null or, order, outer, output parallel, pig, PigDump, PigStorage, pwd quit register, right, rm, rmf, run sample, set, ship, SIZE, split, stderr, stdin, stdout, store, stream, SUM TextLoader, TOKENIZE, through, tuple union, using = = != < > <= >= + - * / % ? $ . # :: ( ) [ ] { }
  • 11. Thanx