随笔分类 -  Hive

摘要:1.首先创建表 create table user( id int, name string, address string ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE; 2.创建索引 create index 阅读全文
posted @ 2019-03-23 15:15 Coding_Now 阅读(7421) 评论(2) 推荐(1) 编辑
摘要:1.创建数据库 hive>create database myhive; hive>create database if not exists myhive; hive>show databases; hive>show databases like '*t*'; 说明:hive为创建的数据库生成了 阅读全文
posted @ 2018-08-27 09:10 Coding_Now 阅读(434) 评论(0) 推荐(0) 编辑
摘要:1.默认存储格式为:纯文本 stored as textfile; 2.二进制存储的格式 顺序文件,avro文件,parquet文件,rcfile文件,orcfile文件。 3.转存parquet格式 hive>create table hive.stocks_parquet stored as p 阅读全文
posted @ 2018-08-14 13:13 Coding_Now 阅读(3942) 评论(0) 推荐(1) 编辑
摘要:0.创建数据库 hive>create table hive.test(id int); hive>load data local inpath '/home/hyxy/test_order.txt' into table hive.test; 1.order by 全局排序 hive>select 阅读全文
posted @ 2018-08-14 13:07 Coding_Now 阅读(2438) 评论(0) 推荐(0) 编辑
摘要:表的修改 1.alter table 修改表的元数据: a.修改表名称 hive>alter table student rename to student1; b.修改表分区 hive>alter table hive.logs add partition (dt='2018-9-1',count 阅读全文
posted @ 2018-08-14 12:54 Coding_Now 阅读(873) 评论(0) 推荐(0) 编辑
摘要:含义:实质是将数据分成不同的文件。hive中的分桶和hadoop中的reduce个数相同。 首先设置采用分桶: hive>set hive.enforce.bucketing=true; hive>create table buckets_users(id int,name string) clus 阅读全文
posted @ 2018-08-14 12:32 Coding_Now 阅读(240) 评论(0) 推荐(0) 编辑
摘要:hive的基本数据类型 1.基本数据类型 hive类型 说明 java类型 实例 1).tinyint 1byte有符号的整数 byte 20 2).smalint 2byte有符号的整数 short 20 3).int 4byte有符号的整数 int 20 4).bigint 8byte有符号的整 阅读全文
posted @ 2018-08-13 15:31 Coding_Now 阅读(10893) 评论(0) 推荐(0) 编辑
摘要:1.安装MySql,参照上篇博文 2.修改hive的配置文件 a.{HIVE_HOME/conf}目录下,复制hive-env.sh.template $>cp hive-env.sh.template hive-env.sh $>gedit hive-env.sh 添加:【 export HADO 阅读全文
posted @ 2018-08-13 14:55 Coding_Now 阅读(369) 评论(0) 推荐(0) 编辑
摘要:yum安装1.验证Centos是否安装MySQL $>yum list installed | grep mysql 2.删除MySql $>yum –y remove mysql-libs.X86_64 或 $>yum erase mysql-libs.x86_64 3.验证删除是否成功! $>y 阅读全文
posted @ 2018-08-13 14:44 Coding_Now 阅读(1375) 评论(0) 推荐(0) 编辑
摘要:架构 1.hive是数据仓库,在hadoop基础上处理结构化数据;它驻留在hadoop之上,用户对数据的统计,查询和简单的分析操作。 2.hive不是 a.关系型数据库 b.OLTP c.实时查询和行级更新操作 3.hive特点 a.表模型存储在database(关系型)中,处理的数据存储在HDFS 阅读全文
posted @ 2018-08-13 14:23 Coding_Now 阅读(2333) 评论(0) 推荐(1) 编辑
摘要:1.定义 Apache Hive数据仓库软件便于读,写和管理大型数据集驻留在分布式存储使用SQL。 结构可以投影到存储中的数据上。 客户端的连接方式可采用:command line 和 JDBC Driver。 注意:Hive实质就是客户端,不存在主从结构,搭建过程没有集群概念。 2.搭建Hive 阅读全文
posted @ 2018-08-13 14:05 Coding_Now 阅读(231) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示