- April 13, 2017 at 10:08 am #3222
A. Count number of countries based on landmass.
B. Count of countries with icon.
C. Count of countries which have same top left and top right color in flag.
D. Count number of countries based on zone.
E. Sum of all circles present in all country flags.
F. Count of countries which have both icon and text in flag.April 13, 2017 at 2:59 pm #3224
Remove double quotation
[cloudera@localhost ~]$ sed s/\”//g ‘Load Data.csv’ > load1.csv;
Load data to hdfs
[cloudera@localhost ~]$ hadoop dfs -put ‘/Desktop/Load Data.csv’ /user/cloudera;
create table country(name String,landmass int,zone int, area int,population int, language int,religion int,bars int,strips int,colours int,red int,green int,blue int,gold int,white int,black int,orrange int,mainhue String,circles int,crosses int,saltires int,quarters int,sunstars int,crescent int,triangle int,icon int,animate int,text int,topleft String,botright String)row format delimited fields terminated by ‘,’ stored as textfile;
A. select count(name) from country group by landmass;
B. select count(name) from country where icon == 1;
C. select count(name) from country where topleft == botright;
D. select count(name),zone from country group by zone;
E. select sum(circles) from country;
F. select count(name) from country where icon==1 AND text==1;