Time for action – creating a table for the UFO data
Perform the following steps to create a table for the UFO data:
Start the Hive interactive shell:
$ hive
Create a table for the UFO data set, splitting the statement across multiple lines for easy readability:
hive> CREATE TABLE ufodata(sighted STRING, reported STRING, sighting_location STRING, > shape STRING, duration STRING, description STRING COMMENT 'Free text description') COMMENT 'The UFO data set.' ;
You should see the following lines once you are done:
OK Time taken: 0.238 seconds
List all existing tables:
hive> show tables;
You will receive the following output:
OK ufodata Time taken: 0.156 seconds
Show tables matching a regular expression:
hive> show tables '.*data';
You will receive the following output:
OK ufodata Time taken: 0.065 seconds
Validate the table specification:
hive> describe ufodata;
You will receive the following output:
OK sighted string reported string sighting_location string shape...