Hive 简单操作

1建表:

建表语句形式1:
Create table table_name(col_name1 type ,col_name2 type,… )

row format DELIMITED FIELDS TERMINATED BY '\t'

location ‘/user/$username/warehouse/tables/table_name’

建表实例1:
create table hue_fengchao_test23(a int,b string)

row format DELIMITED FIELDS TERMINATED BY '\t'

location '/user/fengchao/warehouse/tables/hue_fengchao_test23'

 

建表语句形式2:
Create table table_namerow

format DELIMITED FIELDS TERMINATED BY '\t'

location ‘/user/$username/warehouse/tables/table_name’ as select_statement

建表实例2:
create table hue_fengchao_test24row

format DELIMITED FIELDS TERMINATED BY '\t'

location '/user/fengchao/warehouse/tables/hue_fengchao_test24' as select * from user_group

 

 

 

posted on 2012-07-09 14:33  NLP新手  阅读(690)  评论(0编辑  收藏  举报

导航