zoukankan      html  css  js  c++  java
  • 同一数据库中hive之双表join联合查询

    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
    
  • 相关阅读:
    IIS使用十大原则,(IIS过期时间,IIS缓存设置) 【转载】
    微软中国的相关研发团队 交流平台
    Excel文件减肥和加速
    二进制与字符串之间的转换
    调度模式·WorkerChannelRequest
    引用Hibernate的Java桌面程序打包方法
    [收藏]Open CASCADE
    需要天天读月月读年年读的书
    geotools的dotnet版本
    FC4 下ns2.28的安装 (zz)
  • 原文地址:https://www.cnblogs.com/likai198981/p/2989740.html
Copyright © 2011-2022 走看看