Hive Assignment
Hive Assignment
External table creation in Hive and loading the ingested data into it. Data ingestion
verification.
1. Command to create the external table
hive> create external table if not exists indiaahs_extdata (
> `ID` int,
> `State_Name` string,
> `State_District_Name` string,
> `AA_Sample_Units_Total` int,
> `AA_Sample_Units_Rural` int,
> `AA_Sample_Units_Urban` int,
-
-
-
> `AA_Children_12_23_Months_Urban` int,
> `BB_Average_Household_Size_Sc_Total` float,
> `BB_Average_Household_Size_Sc_Rural` float,
> `BB_Average_Household_Size_Sc_Urban` float,
> `BB_Average_Household_Size_St_Total` float,
-
-
-
> `ZZ_Sex_Ratio_At_Birth_Total_Lower_Limit` int,
> `ZZ_Sex_Ratio_At_Birth_Total_Upper_Limit` int,
> `ZZ_Sex_Ratio_At_Birth_Rural_Lower_Limit` int,
> `ZZ_Sex_Ratio_At_Birth_Rural_Upper_Limit` int,
> `ZZ_Sex_Ratio_At_Birth_Urban_Lower_Limit` int,
> `ZZ_Sex_Ratio_At_Birth_Urban_Upper_Limit` int)
> row format delimited fields terminated by ','
> location '/hive/data/indiaahs_data';
OK
Time taken: 1.902 seconds
Hue:
Hue is not working in my hadoop cluster
b. Query to select the top 10 rows and first 8 columns along with the screenshots
of the data fetched by the query on MySQL Workbench and Hue
Query:
select ID, State_Name, State_District_Name, AA_Sample_Units_Total, AA_Sample_Units_Rural,
AA_Sample_Units_Urban, AA_Households_Total, AA_Households_Rural
from Key_indicator_districtwise limit 10;
MySQL Workbench:
Hue:
Hue is not working in my hadoop cluster