同一数据库中hive之双表join联合查询
2013-03-29 22:25
260 查看
hive (student)> show tables; OK course student_test Time taken: 0.056 seconds hive (student)> select * from course; OK 1 ["English","Chinese","French","Japanese"] 2 ["Chinese","French"] 3 ["Chinese","French","Japanese"] 4 ["Chinese","French","India"] 5 ["Chinese","French","Green"] Time taken: 0.38 seconds hive (student)> select * from student_test; OK 1 {"name":"KaiLee","age":24} 2 {"name":"DuoPing","age":24} 3 {"name":"JiangTao","age":25} 4 {"name":"LiuRiJi","age":23} 5 {"name":"GuangYuan","age":25} Time taken: 0.111 seconds hive (student)> describe student_test; OK id int the number of a student basic_info struct<name:string,age:int> the basic information of a student Time taken: 0.119 seconds hive (student)> describe course; OK stu_num string the number of a student choose_course array<string> the choosing course of a student Time taken: 0.091 seconds hive (student)> select s.basic_info.name,c.choose_course from student_test s join course c > on s.id = c.stu_num; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks not specified. Estimated from input data size: 1 In order to change the average load for a reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> In order to limit the maximum number of reducers: set hive.exec.reducers.max=<number> In order to set a constant number of reducers: set mapred.reduce.tasks=<number> Starting Job = job_201303271617_0014, Tracking URL = http://localhost:50030/jobdetails.jsp?jobid=job_201303271617_0014 Kill Command = /home/landen/UntarFile/hadoop-1.0.4/libexec/../bin/hadoop job -kill job_201303271617_0014 Hadoop job information for Stage-1: number of mappers: 2; number of reducers: 1 2013-03-29 22:13:21,374 Stage-1 map = 0%, reduce = 0% 2013-03-29 22:14:27,913 Stage-1 map = 0%, reduce = 0% 2013-03-29 22:14:46,595 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:47,597 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:48,600 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:49,603 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:50,607 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:51,610 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:52,613 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:53,615 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:54,618 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:55,625 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:56,629 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:57,633 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:58,635 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:14:59,638 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:15:00,642 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 3.64 sec 2013-03-29 22:15:01,645 Stage-1 map = 100%, reduce = 33%, Cumulative CPU 3.64 sec 2013-03-29 22:15:02,648 Stage-1 map = 100%, reduce = 33%, Cumulative CPU 3.64 sec 2013-03-29 22:15:03,657 Stage-1 map = 100%, reduce = 33%, Cumulative CPU 3.64 sec 2013-03-29 22:15:04,663 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:05,679 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:06,686 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:07,690 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:08,698 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:09,702 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec 2013-03-29 22:15:10,706 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 6.14 sec MapReduce Total cumulative CPU time: 6 seconds 140 msec Ended Job = job_201303271617_0014 MapReduce Jobs Launched: Job 0: Map: 2 Reduce: 1 Cumulative CPU: 6.14 sec HDFS Read: 720 HDFS Write: 155 SUCCESS Total MapReduce CPU Time Spent: 6 seconds 140 msec OK KaiLee ["English","Chinese","French","Japanese"] DuoPing ["Chinese","French"] JiangTao ["Chinese","French","Japanese"] LiuRiJi ["Chinese","French","India"] GuangYuan ["Chinese","French","Green"] Time taken: 119.14 seconds
相关文章推荐
- Sql Server 多数据库联合查询
- 00104 SQL查询进阶2:多表联合查询JOIN
- 数据库联合查询的思考
- LINQ,EF联合查询join
- hive多表联合查询(GroupLens->Users,Movies,Ratings表)
- Hive 文件格式 & Hive操作(外部表、内部表、区、桶、视图、索引、join用法、内置操作符与函数、复合类型、用户自定义函数UDF、查询优化和权限控制)
- Hive 连接查询JOIN
- 数据库的联合查询
- hibernate中HQL查询补充(联合查询,inner join,left outer join,子查询的使用)
- hadoop 联合查询 join
- Lucene4.10.4实践 索引联合查询数据库实现查询更快
- EntityFramework查询--联合查询(Join,GroupJoin)
- 数据库——(10)联合查询和子查询
- mysql 联合查询 join 用法举例
- sql语句的联合查询(join 用法)
- 关于hive 子查询、union 、left join
- thinkphp 数据库设置前缀问题 联合查询
- cakephp2.X多表联合查询join及使用分页查询的方法
- 走向面试之数据库基础:二、SQL进阶之case、子查询、分页、join与视图
- 数据库联合查询—小知识大攻略