I created a table in hive which by deafult is manage table.
create table countryTable(name string,landmass int,zone int,area int,population int, language int,religion int,bars int, stripes int,colors int,red int,green int,blue int,gold int,white int,black int,orange 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 ',';
Now, I need to execute some query such as counting the red,green and blue columns. Then I need to insert the result datas into a external table. I have created a external table.
create external table if not exists extConTable( colorName string, colorCount int ) row format delimited fields terminated by '\t' location '/home/cloudera/desktop';
How can I execute some operation in hive and insert that result into external table?