首页 > 代码库 > hive建立外表

hive建立外表

使用数据源建立hive外表,不覆盖或移动数据源

写法格式:

CREATE EXTERNAL TABLE see2seebase(product_id string, rec_id string, score double) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' 
LOCATION '数据源';

Sample:

DROP TABLE IF EXISTS see2seebase;
CREATE EXTERNAL TABLE see2seebase(product_id string, rec_id string, score double) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' 
LOCATION '/user/pms/recsys/algorithm/cf/see_also_see/data/app_data_layer1/2014-10-07';

hive建立外表