hive-测试
hive ##------命令行直接输入,如果没有这个命令,看环境变量是否添加,或者profile是否生效。
hive> show functions;
OK
!
!=
$sum0
%
&
*
+
-
/
<
<=
<=>
<>
=
==
>
>=
^
abs
acos
add_months
aes_decrypt
aes_encrypt
and
array
array_contains
ascii
asin
assert_true
....
###新建hive数据库
create database db_hive;
###创建数据表
use db_hive;
create table address(id int,name string)row format delimited fields terminated by '\t';
vim /home/test/hive/1.txt
001 shanghai
002 chengdu
003 guangzhou
004 wuhang
005 changsha
#注意:id和name直接是TAB键,不是空格,因为在上面创建表的语句中用了terminated by '\t'所以这个文本里id和name的分割必须是用TAB键
#执行hive加载数据
load data local inpath '/home/test/1.txt' into table db_hive.address;
select * from address;