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. C#之Action和Func

    以前我都是通过定义一个delegate来写委托的,但是最近看一些外国人写的源码都是用action和func方式来写,当时感觉对这很陌生所以看起源码也觉得陌生,所以我就花费时间来学习下这两种方式,然后发 ...

  2. ::selection伪元素改变文本选中颜色

    在看张鑫旭大神的文章,刚刚发现了这个,感觉应该后面有用,先存起来. 效果如下: 代码如下: <!DOCTYPE html> <html> <head> <me ...

  3. ASE19团队项目alpha阶段model组 scrum11 记录

    本次会议于11月15日,19时整在微软北京西二号楼sky garden召开,持续5分钟. 与会人员:Jiyan He, Kun Yan, Lei Chai, Linfeng Qi, Xueqing W ...

  4. 【loj#6220】sum

    题目传送门:https://loj.ac/problem/6220 题意:对于一个序列$a$,找出它的一个子序列$b$,使$\sum_{a_i \in b}a_i \equiv 0 \pmod n$ ...

  5. vue-element-admin 之改变登录界面input的光标颜色

    前话:用框架原有的login更改而不重写的话,恰好当你input背景设置成白色的时候,光标会找不到=>原因:原框架的光标颜色是#fff 操作更改光标颜色: 找到src/views/login/i ...

  6. gitlab 错误处理

    用gitolite新建项目,clone后首次push,可能会出现: $ git push No refs in common and none specified; doing nothing. Pe ...

  7. ubuntu18系统 Qt Error BadAccess

    现象:在ubuntu18中报错 X Error: BadAccess (attempt to access private resource denied) 10  Extension:    130 ...

  8. python_推导式

    列表推导式 目的:方便的生成一个列表 格式: v1 = [i for i in 可迭代对象 ] v2 = [i for i in 可迭代对象 if条件]#条件为True菜进行append v1 = [ ...

  9. C# 对象和类型(2) 持续更新

    类 class PhoneClass  { public const string DayOfSendingBill = "Monday"; public int Customer ...

  10. 原生XMLHttpRequest (ajax)的简单使用

    示例: 第一步:创建XMLHttpRequest对象 var httpxml ; if(window.XMLHttpRequest){ //大多数浏览器 httpxml = new XMLHttpRe ...