Skip to Main Content
Apache Hive Essentials - Second Edition
book

Apache Hive Essentials - Second Edition

by Dayong Du
June 2018
Beginner to intermediate content levelBeginner to intermediate
210 pages
5h 12m
English
Packt Publishing
Content preview from Apache Hive Essentials - Second Edition

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>> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Apache Hive Essentials

Apache Hive Essentials

Dayong Du
Apache Hive Cookbook

Apache Hive Cookbook

Hanish Bansal, Saurabh Chauhan, Shrey Mehrotra
Apache Spark Quick Start Guide

Apache Spark Quick Start Guide

Shrey Mehrotra, Akash Grade

Publisher Resources

ISBN: 9781788995092Supplemental Content