http://web.cse.ohio-state.edu/hpcs/WWW/HTML/publications/papers/TR-11-7.pdf 

  1. Introduce
    样例sql语句:“what is the average number of pages a user
    visits between a page in category X and a page in category
    Y?” 

    1. MR对复杂查询有限制(Limitations of MapReduce for Complex Queries):
      1. MR在本地磁盘保存中间文件(为了容错),临时结果需要存到hdfs
      2. hadoop不感知并行job之间的关联
    2. 查询内关联(Intra-query Correlations)
  2. 背景。 很简明扼要的介绍了MR、hive的运行机制。
  3. 关联识别的MR概述。III. CORRELATION-AWARE MAPREDUCE: AN OVERVIEW
    说明为什么要做关联识别:MR对中间结果的处理要比DBMS要代价高很多,所以将多个操作集中在一个MR中效率高。 the way of executing multiple
    operations in a single job (many-to-one), if possible, could be
    a much more effective choice than the one-to-one translation
  4. 内部关联以及优化原理。IV. INTRA-QUERY CORRELATIONS AND THEIR
    OPTIMIZATION PRINCIPLES
    1. 关联类型和优化收益Types of Correlations and the Optimization Benefits
      1. 输入关联:Multiple nodes have input correlation
        (IC) if their input relation sets are not disjoint
        两个操作可以共享一个表扫描
      2. 转换关联Transit Correlation: Multiple nodes have transit correlation
        (TC) if they have not only input correlation, but
        also the same partition key;
        存在数据交叠,存在冗余的IO操作
      3. 流程关联。Job Flow Correlation: A node has job flow correlation
        (JFC) with one of its child nodes if it has the same
        partition key as that child node
        后面的MR可以在前一个MR的reduce里面直接执行
        1. 带group的聚合。An aggregation node with grouping can be directly
          executed in the reduce function of its only child node;
        2. A join node J1 has job flow correlation with only one
          of its child nodes C1. Thus as long as the job of another
          child node of this join node C2 has been completed, a
          single job is sufficient to execute both C1 and J1
        3. A join node J1 has job flow correlation with two child
          nodes C1 and C2. Then, according to the correlation
          definitions, C1 and C2 must have both input correlation
          and transit correlation. Thus a single job is sufficient to
          execute both C1 and C2. Besides, J1 can also be directly
          executed in the reduce phase of the job
    2. An Example of Correlation Query and Its Optimization
      sql以及原始的执行计划(3个MR)


      Ysmart后:
  5. YSmart如何残生job V. JOB GENERATION IN YSMART
    1. Primitive Job Types,4中原生操作类型:
      1. 选择和投影。A SELECTION-PROJECTION (SP) Job is used to execute
        a simple query with only selection and projection
        operations on a base relation
      2. 聚合。An AGGREGATION (AGG) job is used to execute
        aggregation and grouping on an input relation
      3. 关联合并。A JOIN job is used to execute an equi-join (inner or
        left/right/full outer) of two input relations;
      4. 排序。A SORT job is used to execute a sorting operation.
    2. Job Merging job合并
      输入关联和转换关联将在map里面合并;流程关联将在reduce里面合并
      1. rule 1:如果两个job有输入关联和转换关联,将被合并。If two jobs have input correlation and transit
        correlation, they will be merged into a common job.
      2. Rule 2: 一个聚合job如果仅与它前面的一个job有流程关联,那该聚合job可以合并到前面job的reduce中。An AGGREGATION job that has job flow correlation
        with its only preceding job will be merged into this
        preceding job.
      3. Rule 3:  如果一个join job与它前面的两个job有输入关联,这个join job可以合并。For a JOIN job with job flow correlation with its
        two preceding jobs, the join operation will be merged into the
        reduce phase of the common job。 In this case, there must be
        transit correlation between the two preceding jobs, and the two
        jobs have been merged into a common job in the first step.
        Based on this, the join operation can be put into the reduce
        phase of the common job
      4. Rule 4: For a JOIN job that has job flow correlation with
        only one of its two preceding jobs, merge the JOIN job with
        the preceding job with job flow correlation – which has to be
        executed later than the other one.
    3. An Example of Job Merging
      We assume that 1) JOIN1 and AGG2 have input correlation and transit correlation, 2) JOIN2 has
      job flow correlation with JOIN1 but not AGG1, and 3) JOIN3
      has job flow correlation with both JOIN2 and AGG2. In the
      figure, we show the job number for each node.

      后续遍历执行计划,得到job序列:{J1, J2, J3, J4, J5}. 执行rule 1 得到{J1+4, J2, J3, J5}. 执行其他规则得到{J1+4, J2, J3+5}. -》s {J2, J1+4+3+5}
  6. 通用MR框架。VI. THE COMMON MAPREDUCE FRAMEWORK
    解决两个问题:
    1. The first requirement is to provide a flexible framework
      to allow different types of MapReduce jobs
    2. The second requirement is to execute multiple merged jobs
      in a common job with minimal overhead
    • CMF提供合并两个关联job的通用模板。CMF provides a general template based approach to generate
      a common job that can merge a collection of correlated
      jobs。The template has the following structures. The common
      mapper
      executes operations (selection and/or projection
      operations) involved in the map functions of merged jobs.
      The common reducer executes all the operations (e.g. join or
      aggregation) involved in the reduce functions of merged jobs.
      The post-job computation is a subcomponent in the common
      reducer to execute further computations on the outputs of
      merged jobs.
    1. Common Mapper
      读取一行数据,然后产生key-value给所有的被合并的job。由于不同的被合并的job有不同的选择条件,所有common mapper需要记录job对应哪些数据。
      1. 投影信息被保存在job级别的配置属性中;
      2. 每个值都有一个tag指明哪个reduce会用到这个值。(记录不使用这个值的job id)
    2. Common Reducer and Post-job Computations
      common reduce不限制他能实现的功能。它读一些列key-value,按投影信息分配给所有的被合并的reducer(这些reducer有三个接口)
      1)init; 2) next 处理每个值;3)final 计算所有值
      这样又两个优点:通用且允许任何类型的reducer被合并;高效,因为只有一次迭代遍历。
      common reducer输出结果到hdfs,并且外加一个tag指明这个结果来自哪个源。
      如果存在job-a存在流程关联,将立即在post-job流程中计算这个job-a,并且输出的结果是job-a的结果。
  7. 负载分析。Workloads and Analysis






笔记:YSmart: Yet Another SQL-to-MapReduce Translator的更多相关文章

  1. Hadoop阅读笔记(一)——强大的MapReduce

    前言:来园子已经有8个月了,当初入园凭着满腔热血和一脑门子冲动,给自己起了个响亮的旗号“大数据 小世界”,顿时有了种世界都是我的,世界都在我手中的赶脚.可是......时光飞逝,岁月如梭~~~随手一翻 ...

  2. MySQL笔记(5)-- SQL执行流程,MySQL体系结构

    MySQL的体系结构,可以清楚地看到 SQL 语句在 MySQL 的各个功能模块中的执行过程:Server层包括连接层.查询缓存.分析器.优化器.执行器等,涵盖MySQL的大多数核心服务功能,以及所有 ...

  3. MySQL笔记(6)-- SQL更新语句日志系统流程

    一.背景 在上一篇[MySQL笔记(5)-- SQL执行流程,MySQL体系结构]中讲述了select查询语句在MySQL体系中的运行流程,从连接器开始,到分析器.优化器.执行器等,最后到达存储引擎. ...

  4. 关于Hive的调优(本身,sql,mapreduce)

    1.关于hive的优化 ->大表拆分小表 ->过滤字段 ->按字段分类存放 ->外部表与分区表 ->外部表:删除时只删除元数据信息,不删除数据文件 多人使用多个外部表操作 ...

  5. MYSQL基础笔记(二)-SQL基本操作

    SQL基本操作 基本操作:CRUD,增删改查 将SQL的基本操作根据操作对象进行分类: 1.库操作 2.表操作 3.数据操作 库操作: 对数据库的增删改查 新增数据库: 基本语法: Create da ...

  6. 060 关于Hive的调优(本身,sql,mapreduce)

    1.关于hive的优化 ->大表拆分小表 ->过滤字段 ->按字段分类存放 ->外部表与分区表 ->外部表:删除时只删除元数据信息,不删除数据文件 多人使用多个外部表操作 ...

  7. sql注入学习笔记,什么是sql注入,如何预防sql注入,如何寻找sql注入漏洞,如何注入sql攻击 (原)

    (整篇文章废话很多,但其实是为了新手能更好的了解这个sql注入是什么,需要学习的是文章最后关于如何预防sql注入) (整篇文章废话很多,但其实是为了新手能更好的了解这个sql注入是什么,需要学习的是文 ...

  8. oracle从入门到精通复习笔记续集之PL/SQL(轻量版)

    复习内容: PL/SQL的基本语法.记录类型.流程控制.游标的使用. 异常处理机制.存储函数/存储过程.触发器. 为方便大家跟着我的笔记练习,为此提供数据库表文件给大家下载:点我下载 为了要有输出的结 ...

  9. 大数据笔记(十)——Shuffle与MapReduce编程案例(A)

    一.什么是Shuffle yarn-site.xml文件配置的时候有这个参数:yarn.nodemanage.aux-services:mapreduce_shuffle 因为mapreduce程序运 ...

  10. Docker学习笔记之--安装mssql(Sql Server)并使用Navicat连接测试(环境:centos7)

    前一节演示如何使用Nginx反向代理 .net Core项目容器,地址:Docker学习笔记之-部署.Net Core 3.1项目到Docker容器,并使用Nginx反向代理(CentOS7)(二) ...

随机推荐

  1. 学习cesium,关于图层界面的切换

    最近学习cesium的3D引擎,有关图层切换的例子比较少,在官网上看见了一些例子加以自己的理解.投机了一种近似于图层切换的效果. 这种图层切换每次点击按钮时,会把其他的数据和实体给删除.然后再创建或加 ...

  2. Linux下mysql不区分大小写设置

    Linux环境下的MySQL数据库的表名默认是区分大小写的 Windows环境下的MySQL数据库的表名默认是不区分大小写的 所以Linux下想mysql不区分下大写可以查看/etc/my.cnf文件 ...

  3. 用Leangoo做敏捷需求管理

    转自:https://www.leangoo.com/9229.html 传统的瀑布工作模式使用详细的需求说明书来表达需求,需求人员负责做需求调研,根据调研情况编制详细的需求说明书,进行需求评审,评审 ...

  4. 在Ubuntu中使用uwsgi 启动 Django ,但是静态文件映射出错

    错误 :  找不到/static/下面的静态文件 解决方法: 在uswgi.ini 文件中配置参数 static-map=/static=/home/wb/Desktop/test_django/st ...

  5. python基础:流程控制案例:

    1,简述编译型与解释型的语言,且分别列出你知道的哪些语言属于编译型,哪些属于解释型. 答:简单理解编译型语言类似谷歌翻译,整篇读入整篇翻译,代表语言有C语言,解释型语言类似同   声传译,读入一行翻译 ...

  6. CentOS7 解决不能切换中英文输入法的问题

    1. 运行 im-chooser(如果没有要先安装) $ im-chooser 2. 在打开的窗口选择 iBus,然后 Logout 再 Login, 输入法即可切换.

  7. jenkins 配置主从机制(master-slaver)

    1. 中文:系统管理——节点管理——新建节点(左上侧) 英文:Manage Jenkins——Manage Node——新建节点(左上侧) 2. 中文配图 英文配图: 3. 远程工作目录 以mac为例 ...

  8. jwt、token

    什么是JWT jwt是一段密文;然而密码是如何产生的? 密码是由三个部分生成: 1.JWT头:JWT头部分是一个描述JWT元数据的JSON对象:{"alg":"hash2 ...

  9. LVS Nginx和HAproxy的区别,怎么选择最好

    LVS Nginx和HAproxy有什么区别呢? LVS:Linux Virtual Server的简写,意即Linux虚拟服务器,是一个虚拟的服务器集群系统. Nginx:Nginx是一款轻量级的w ...

  10. linux (wsl) npm 无法安装包

    错误代码如下 request to https://registry.npm.taobao.org/yrm failed, reason: getaddrinfo EAI_AGAIN registry ...