Hive 创建内部表、外部表和临时表

hive创建内部表

// 创建内部表
create table earth_inner(
MMSI string,
Message_ID string,
Repeat_indicator string,
Time string,
Millisecond string,
Region string,
Country string
)
row format delimited fields terminated by '\t' 
LOCATION '/hive/warehouse/testing.db/earth_inner';

hive创建外部表

// 创建外部表
create external table earth_external(
MMSI string,
Message_ID string,
Repeat_indicator string,
Time string,
Millisecond string,
Region string,
Country string
)
row format delimited fields terminated by '\t' 
LOCATION '/hive/warehouse/testing.db/earth_external';

hive创建临时表

// 创建外部表
create TEMPORARY table earth_temporary(  
MMSI string,
Message_ID string,
Repeat_indicator string,
Time string,
Millisecond string,
Region string,
Country string
)
row format delimited  fields terminated by '\t';
// 将本地数据加载到临时表
load data local inpath '/home/kobe/earth_temporary.txt' into table earth_temporary;

hive命令行显示当前数据库

set hive.cli.print.current.db=true;
发布了128 篇原创文章 · 获赞 35 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq262593421/article/details/104612242