Time for action – creating a table for the UFO data

Perform the following steps to create a table for the UFO data:

  1. Start the Hive interactive shell:
    $ hive
    
  2. 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
    
  3. List all existing tables:
    hive> show tables;
    

    You will receive the following output:

    OK
    ufodata
    Time taken: 0.156 seconds
    
  4. Show tables matching a regular expression:
    hive> show tables '.*data';
    

    You will receive ...

Get Hadoop Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.