Skip to content
/ hive Public

Hive/Beehive sample projects w/ loading data; partitioning; bucketing etc.,

Notifications You must be signed in to change notification settings

venupec/hive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Connect to Beeline

Create a partition

Loading data into Beeline

  1. Load the data into external table from the following query
CREATE EXTERNAL TABLE page_view_stg(viewTime INT, userid BIGINT, page_url STRING, referrer_url STRING, ip STRING COMMENT 'IP Address of the User', country STRING COMMENT 'country of origination') COMMENT 'This is the staging page view table' ROW FORMAT DELIMITED FIELDS TERMINATED BY '44' LINES TERMINATED BY '12' STORED AS TEXTFILE LOCATION '/user/data/staging/page_view';

Store the partitioned data in HDFS

hadoop dfs -put /tmp/pv_2008-06-08.txt /user/data/staging/page_view

Load the partitioned data into Hive table already created

FROM page_view_stg pvs INSERT OVERWRITE TABLE page_view PARTITION(dt='2008-06-08', country='US') SELECT pvs.viewTime, pvs.userid, pvs.page_url, pvs.referrer_url, null, null, pvs.ip WHERE pvs.country = 'US';

About

Hive/Beehive sample projects w/ loading data; partitioning; bucketing etc.,

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published