O'Reilly logo

Apache Hive Essentials by Dayong Du

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Table creation

The following are major DDLs for the internal and external table creation:

  1. Show the data file content of employee.txt:
      $ vi /home/hadoop/employee.txt      Michael|Montreal,Toronto|Male,30|DB:80|Product:Developer^DLead      Will|Montreal|Male,35|Perl:85|Product:Lead,Test:Lead      Shelley|New York|Female,27|Python:80|Test:Lead,COE:Architect      Lucy|Vancouver|Female,57|Sales:89,HR:94|Sales:Lead
  1. Create an internal table and load the data:
      > CREATE TABLE IF NOT EXISTS employee_internal (      > name STRING COMMENT 'this is optinal column comments',      > work_place ARRAY<STRING>,-- table column names are NOT case       sensitive      > gender_age STRUCT<gender:STRING,age:INT>,       > skills_score MAP<STRING,INT>, -- columns names are lower case      > depart_title MAP<STRING,ARRAY<STRING>> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required