Describe:
Hive Table Pms.cross_sale_path is established with the date as the partition, the HDFs directory/user/pms/workspace/ouyangyewei/testusertrack/job1output/ The data on the Crosssale, written on the $yesterday partition of the table
Table structure:
HIVE-E "Set Mapred.job.queue.name=pms;drop table if exists pms.cross_sale_path;create external table Pms.cross_sale_ Path (track_id string,track_time string,session_id string,gu_id string,end_user_id string,page_category_id bigint, algorithm_id int,is_add_cart int,rcmd_product_id bigint,product_id bigint,category_id bigint,path_id string,path_ Type int,path_length int,path_list String,order_code string) partitioned by (DS string) ROW FORMAT delimited fields Termina TED by ' \ t ' LINES TERMINATED by ' \ n ' STORED as textfile;
Writing:
Yesterday= ' date-d -1days +%y-%m-%d ' hive-e ' Load data inpath '/user/pms/workspace/ouyangyewei/testusertrack/ Job1output/crosssale ' into table Pms.cross_sale_path partition (ds= ' $yesterday '); "
Hive creates hive table partitions using HDFS directory data