Database Reference
In-Depth Information
of fact, you may recall that HCatalog actually uses a subset of Hive DDL
statements. Create the sensor staging table with the following code:
CREATE TABLE sensor_stg(dt String, time String,
target_tmp Int,
actual_tmp Int, system Int, system_age
Int,building_id Int)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';
2. Load the data into the staging table:
LOAD DATA Local INPATH 'C:\SampleData\HVAC.csv'
INTO TABLE sensor_stg;
3. Use the following statement to view the data to verify that it loaded.
Your data should look similar to Figure 7.10 :
Select * from sensor_stg Limit 10;
Figure 7.10 Sample sensor data.
4. Using the same process, load the building data into a staging table:
CREATE TABLE building_stg(building_id Int, mgr
String,
building_age Int,
hvac_type String, country String)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';
LOAD DATA Local INPATH 'C:\SampleData\building.csv'
INTO TABLE building_stg;
Select * from building_stg Limit 10;
 
 
Search WWH ::




Custom Search