- 博客(6)
- 资源 (2)
- 收藏
- 关注
原创 hive streaming
1. hive 的streaming 包括: map(), reduce(), transform(), 常用的为transform 2. 恒等变换 select transform(name, salary) using "/bin/cat" as new_name, new_salary from employees where country = 'CHINA';
2016-05-10 20:40:46 75600
原创 Hive 调优
1. 使用 explain 查看执行计划 explain extended select count(distinct(name)) from employees; 2. 调整limit 相关参数 一条查询语句如果有limit 限制, 他也会扫描整个表 3. 严格模式 修改hive-site.xml hive.mapred.mode
2016-05-10 11:03:54 75024
原创 Hive 分区
1. 建立多个表,每个表导入不同的数据 create table test_1 (id int); create table test_2 (id int); create table test_3 (id int); ............ 2. 创建分区表 create table test(id int) partitioned by (name sting);
2016-05-10 08:28:41 76028
原创 HiveQL 查询
1. 创建表 CREATE TABLE employees ( name STRING, salary FLOAT, subordinates ARRAY, deductions MAP, address STRUCT ) PARTITIONED BY (country STRING, state STRING) ROW FORMAT DELIMITED FIELDS TE
2016-05-10 08:28:10 75969
原创 hive 基本操作
一. 简单的表操作 1. 创建一个表 create table test(id int); 2. 从本地导入数据 LOAD DATA LOCAL INPATH '/opt/hive/current/testdata/a.txt' INTO TABLE test; 其中a.txt 内容为: 1 2 3 4 3. 测试数据是否导入
2016-05-06 17:11:31 76972
原创 Hive 安装
1.先决条件 要先安装hadoop, 官网下载hadoop-2.7.2.tar.gz 2.安装hive 1)下载hive apache-hive-2.0.0-bin.tar.gz 2)解压 tar -zxzf apache-hive-2.0.0-bin.tar.gz 3)修改/etc/profile文件,添加如下: export HIVE_HOM
2016-05-06 09:54:04 77697
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人