Pig Command Uses
===LOAD====
:: A = LOAD '/home/cloudera/test_names.txt'
USING PigStorage(' '); (Works for
local Mode)
lines = LOAD
'/home/edureka/RANADEEPWS/batch300117/WordCount.txt' USING TextLoader AS
(line:chararray);
V = LOAD '/home/edureka/RANADEEPWS/batch300117/PIG/Visits.csv'
USING PigStorage(',') AS (user:chararray,url:chararray,timestamp:chararray);
P = LOAD
'/home/edureka/RANADEEPWS//batch300117/PIG/Pages.csv' USING PigStorage(',') AS
(url:chararray,prnk:float);
:: dump A;
===FOREACH===
:: b = foreach A generate $0,$4;
:: dump b;
===LOAD WITH SCHEMA===
:: A = LOAD '/home/cloudera/test_names'
USING PigStorage('') as ( sno:int , name:chararray , role:chararray ,
salary:chararray , company:chararray , exp:int);
:: dump A;
===STORE=====
:: STORE A INTO '/user/cloudera/pig1out'
USING PigStorage(' ');
:: STORE A INTO '/user/cloudera/pig1out1';
====DUMP=====
:: dump A;
=====DESCRIBE====
:: describe A;
=====EXPLAIN=====
:: explain A;
///explain the detail about A/////
=====ILLUSTRATE=====
:: illustrate A;
Comments
Post a Comment