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

 

**************************************************************
我喜欢程序员,他们单纯、固执、容易体会到成就感;面对困难,能够不休不眠;面对压力,能够迎接挑战。他们也会感到困惑与傍徨,但每个程序员的心中都有一个比尔盖茨或是乔布斯的梦想,用智慧把属于自己的事业开创。其实我是一个程序员
[=.=]
原文地址:https://www.cnblogs.com/kevinGaoblog/p/2582691.html