Database Reference
In-Depth Information
You should see an output message indicating that a connection to the
metastore is established.
9. To ensure that the data is loaded, you can issue a Dump command to
output the data to the screen (which will take a few minutes):
Dump SensorData;
10. Use the following code to filter out nulls and calculate the temperature
deltas:
FilteredData = Filter SensorData By building_id is
not null;
ProcessedData = Foreach FilteredData Generate dt,
time, target_tmp,
actual_tmp,target_tmp - actual_tmp as
delta_tmp,building_id;
11. The final step is to load the processed data into the sensor table:
STORE ProcessedData INTO 'sensor' USING
org.apache.hcatalog.pig.HCatStorer();
Once the table loads, you can close the CLI.
12. Open the Hive CLI and issue the following query to verify that the
sensor table has been loaded. Your output should look similar to Figure
7.11 . Notice that the data is all coming from the same partition (date):
Select * from sensor Limit 10;
Figure 7.11 Selecting sensor data.
13. Load the building table with the following query:
 
 
Search WWH ::




Custom Search