大数据学习——hive显示命令】的更多相关文章

show databases; desc t_partition001; desc extended t_partition002; desc formatted t_partition002; !clear; !ls; dfs -ls /; 2 DML操作 load load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="Japan"); lo…
1 建表 create table student(id int,name string ,age int) row format delimitedfields terminated by ','; 2 创建一个student.txt 添加数据 ,zhangsan, ,lisi, ,wnagwu, 3 上传 hdfs dfs -put student.txt /user/hive/warehouse/student 4 select * from student; 5 通常不会通过put方式加…
四 查到命令 1 查找可执行的命令所在的路径 which ls 查ls命令所在的路径 2 查找可执行的命令和帮助的位置 whereiis ls 3 从某个文件夹开始查找文件 find / -name "hadoop*" 在根目录下根据名字查找hadoop文件 find / -name "hadoop*" -ls 4查找并删除 find / -name "hadoop*" -ok rm {} \; find /-name "hadoop&…
1. hive的数据类型Hive的内置数据类型可以分为两大类:(1).基础数据类型:(2).复杂数据类型2. hive基本数据类型基础数据类型包括:TINYINT,SMALLINT,INT,BIGINT,BOOLEAN,FLOAT,DOUBLE,STRING,BINARY,TIMESTAMP,DECIMAL,CHAR,VARCHAR,DATE. 3. hive集合类型集合类型主要包括:array,map,struct等,hive的特性支持集合类型,这特性是关系型数据库所不支持的,利用好集合类型可…
1上传压缩包 2 解压 tar -zxvf apache-hive-1.2.1-bin.tar.gz -C apps 3 重命名 mv apache-hive-1.2.1-bin hive 4 设置环境变量 vi /etc/profile expert HIVE_HOME=/root/apps/hiveexport PATH=$PATH:$HIVE_HOME/bin 5 启动hive cd apps/hive bin/hive 出现上面的问题是因为版本不兼容 解决一下版本不兼容问题:替换 app…
三 文件操作 1创建文件 touch somefile.txt 创建一个空文件somefile.txt > 重定向操作符 echo "woshiwoa"> some.txt 将woshiwoa写入到some.txt 文件中,如果文件不存在则会创建出来 echo "www.baidu.com" >> some.txt 将文字追加在文件后面,不会覆盖原文件内容. ll >2.txt 将ll的内容写入到2.txt(先创建2.txt,再查看ll…
1 内置函数 测试各种内置函数的快捷方法: 1.创建一个dual表 create table dual(id string); 2.load一个文件(一行,一个空格)到dual表 3.select substr('angelababy',2,3) from dual; 2 自定义函数UDF(user-defined function)和transform 自定义函数类别 UDF  作用于单个数据行,产生一个数据行作为输出.(数学函数,字符串函数) UDAF(用户定义聚集函数):接收多个输入数据行…
1新建一个数据库 create database db3; 2创建一个外部表 --外部表建表语句示例: create external table student_ext(Sno int,Sname string,Sex string,Sage int,Sdept string) row format delimited fields terminated by ',' location '/stu'; 3添加数据 vi student.txt ,李勇,男,,CS ,刘晨,女,,IS ,王敏,女…
Hive交互shell bin/hive Hive JDBC服务 hive也可以启动为一个服务器,来对外提供 启动方式,(假如是在itcast01上): 启动为前台:bin/hiveserver2 启动为后台:nohup bin/hiveserver2 1>/var/log/hiveserver.log 2>/var/log/hiveserver.err & 启动成功后,可以在别的节点上用beeline去连接 v  方式(1) hive/bin/beeline  回车,进入beelin…
ABC三个hive表 每个表中都只有一列int类型且列名相同,求三个表中互不重复的数 create table a(age int) row format delimited fields terminated by ','; create table b(age int) row format delimited fields terminated by ','; create table c(age int) row format delimited fields terminated by…