ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

马哈鱼直接数据流元素介绍

2022-02-06 23:04:13  阅读:236  来源: 互联网

标签:salary sal 元素 direct 马哈 scott emp 数据流


直接数据流介绍

本文将介绍一些生成直接数据流的SQL元素,这些元素是生产数据流的主要原型。

1、Select

示例语句:

SELECT a.empName "eName" FROM scott.emp a Where sal > 1000

目标列“eName”的数据来自scott.emp.empName列,所以我们有这样一个直接的数据流:

scott.emp.empName -> direct -> RS-1."eName"

选择列表生成的结果集RS-1是一个关系,包括列和行。

dataflow in XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dlineage>
  <table id="2" schema="scott" name="scott.emp" alias="a" type="table" coordinate="[2,6,0],[2,17,0]">
      <column id="3" name="empName" coordinate="[1,8,0],[1,17,0]"/>
  </table>
  <resultset id="5" name="RS-1" type="select_list" coordinate="[1,8,0],[1,25,0]">
      <column id="6" name=""eName"" coordinate="[1,8,0],[1,25,0]"/>
  </resultset>
  <relation id="1" type="fdd" effectType="select">
      <target id="6" column=""eName"" parent_id="5" parent_name="RS-1" coordinate="[1,8,0],[1,25,0]"/>
      <source id="3" column="empName" parent_id="2" parent_name="scott.emp" coordinate="[1,8,0],[1,17,0]"/>
  </relation>
</dlineage>

上述关系表示从id=3的源列到id=6的目标列的数据流.

数据流图示:

2. Function

在数据流分析过程中,function起着关键作用,它接受列作为参数,并生成可能是标量值或集合值的结果。

select round(salary) as sal from scott.emp

在上述SQL中,从列salary到round函数生成一个直接数据流:

scott.emp.salary -> direct -> round(salary) -> direct -> sal

数据流图示:

dataflow in xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dlineage>
  <table id="2" schema="scott" name="scott.emp" type="table" coordinate="[1,34,0],[1,43,0]">
      <column id="3" name="salary" coordinate="[1,14,0],[1,20,0]"/>
  </table>
  <resultset id="5" name="RS-1" type="select_list" coordinate="[1,8,0],[1,28,0]">
      <column id="6" name="sal" coordinate="[1,8,0],[1,28,0]"/>
  </resultset>
  <resultset id="8" name="FUNCTION-1" type="function" coordinate="[1,8,0],[1,21,0]">
      <column id="9" name="round" coordinate="[1,8,0],[1,13,0]"/>
  </resultset>
  <relation id="1" type="fdd" effectType="select">
      <target id="6" column="sal" parent_id="5" parent_name="RS-1" coordinate="[1,8,0],[1,28,0]"/>
      <source id="9" column="round" parent_id="8" parent_name="FUNCTION-1" coordinate="[1,8,0],[1,13,0]"/>
  </relation>
  <relation id="2" type="fdd" effectType="function">
      <target id="9" column="round" parent_id="8" parent_name="FUNCTION-1" coordinate="[1,8,0],[1,13,0]"/>
      <source id="3" column="salary" parent_id="2" parent_name="scott.emp" coordinate="[1,14,0],[1,20,0]"/>
  </relation>
</dlineage>

数据流图示:

如果您关闭“show function”,设置“/if”选项,数据流结果如下:

3、参考

马哈鱼数据血缘分析器: https://sqlflow.gudusoft.com

马哈鱼数据血缘分析器中文网站: https://www.sqlflow.cn

标签:salary,sal,元素,direct,马哈,scott,emp,数据流
来源: https://www.cnblogs.com/syforacle/p/mshayudsqlflow.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有