Last active
February 16, 2022 11:16
-
-
Save svngoku/5cac57d815b254dd47384e808ac20c9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- LOAD THE COUNTRIES DATASETS | |
counteries_datasets = LOAD '/user/hadoop_project/datasets/counteries/african_countries.csv' USING PigStorage(','); | |
-- CREATE COLS FOR COUNTRIES DATASETS | |
countries_details = FOREACH countries_details GENERATE $0 AS id, $1 AS country, $2 AS population, $3 sous_region; | |
-- | |
NameSal = LOAD '/home/asingh50/NameSalary.txt' USING PigStorage(',') AS (name:chararray,salary:chararray); | |
NameSalGroup = GROUP NameSal by (name); | |
NameSalResult = FOREACH NameSalGroup GENERATE group AS Name, BagToString(NameSal.salary, ',') as salary:chararray; | |
-- CREATE THE DATE | |
DateTable = LOAD 'hdfs://localhost:9000/pig_data/dateofbirth.txt' USING PigStorage(',') | |
AS (id: int, year:int); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment