Skip to content

Instantly share code, notes, and snippets.

@saikiranrgda
Created March 14, 2015 10:12
Show Gist options
  • Save saikiranrgda/14add5b692fd3757dd4c to your computer and use it in GitHub Desktop.
Save saikiranrgda/14add5b692fd3757dd4c to your computer and use it in GitHub Desktop.
hive-lspe-in-edit
create table test1.employees (
name string,
age int,
address struct<street:string, state:string, country:string, zip:int>)
PARTITIONED BY (country string,state string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
COLLECTION ITEMS TERMINATED BY '\;'
STORED AS TEXTFILE;
load data local inpath '/root/e1_data' into table test1.employees partition(country='IN', state='KA');
load data local inpath '/root/e2_data' into table test1.employees partition (country='US', state='AK');
dfs -ls /user/root/test1/employees/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment