创建两个partition的hive表

1、创建两个partition的hive表

CREATE EXTERNAL TABLE t_result_analysis_web_stat(
  appid int, 
  type string, 
  key string,   
  statdate string, 
  uv string, 
  pv string,
  extra string)
PARTITIONED BY ( 
  datecol string,identify string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '|' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';

2、结果

18:58 [[email protected]]$ hadoop fs -ls /warehouse/hive/warehouse/ent.db/t_result_analysis_web_stat/datecol=2014-11-23
Found 4 items
drwxr-xr-x   - yule entlog          0 2014-11-24 18:34 /warehouse/hive/warehouse/ent.db/t_result_analysis_web_stat/datecol=2014-11-23/identify=city
drwxr-xr-x   - yule hadoop          0 2014-11-24 18:24 /warehouse/hive/warehouse/ent.db/t_result_analysis_web_stat/datecol=2014-11-23/identify=ip
drwxr-xr-x   - yule entlog          0 2014-11-24 18:39 /warehouse/hive/warehouse/ent.db/t_result_analysis_web_stat/datecol=2014-11-23/identify=isp
drwxr-xr-x   - yule entlog          0 2014-11-24 18:29 /warehouse/hive/warehouse/ent.db/t_result_analysis_web_stat/datecol=2014-11-23/identify=province

相关推荐