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;