当前位置: 首页 > news >正文

企业网站设置地推团队

企业网站设置,地推团队,网站怎么做才不会被封,合肥seo优化Flink SQL支持对动态表进行复杂而灵活的连接操作,本文为您介绍如何使用双流JOIN语句。 背景信息 实时计算的JOIN和传统批处理JOIN的语义一致,都用于将两张表关联起来。区别为实时计算关联的是两张动态表,关联的结果也会动态更新&#xff0c…

Flink SQL支持对动态表进行复杂而灵活的连接操作,本文为您介绍如何使用双流JOIN语句。

背景信息

实时计算的JOIN和传统批处理JOIN的语义一致,都用于将两张表关联起来。区别为实时计算关联的是两张动态表,关联的结果也会动态更新,以保证最终结果和批处理结果一致。

双流JOIN语法

tableReference [, tableReference ]*
| tableExpression [ NATURAL | INNER ] [ { LEFT | RIGHT | FULL } [ OUTER ] ] JOIN tableExpression [ joinCondition ]
| tableExpression CROSS JOIN tableExpression
| tableExpression [ CROSS | OUTER ] APPLY tableExpressionjoinCondition:
ON booleanExpression
| USING '(' column [, column ]* ')'
  • tableReference:表名称。

  • tableExpression:表达式。

  • joinCondition:JOIN条件。

双流JOIN hints

从实时计算引擎VVR 8.0.1 开始,您可以通过提示(Hints)单独为双流JOIN的左右流状态设置不同生命周期 (TTL)来减少维护的状态大小。

  • 语法

    -- VVR 8.0.1 开始
    SELECT /*+ JOIN_STATE_TTL('tableReference1' = 'ttl1' [, 'tableReference2' = 'ttl2']*) */ ...-- VVR 8.0.7 开始,您也可以使用社区的Join State TTL Hint语法
    SELECT /*+ STATE_TTL('tableReference1' = 'ttl1' [, 'tableReference2' = 'ttl2']*) */ ...
  • 注意事项

    • JOIN STATE TTL HINT仅支持在双流JOIN场景使用,不支持维表JOIN、Interval Join或Window Join。

    • 若双流JOIN时JOIN STATE TTL HINT仅指定某一条流的在JOIN节点的状态生命周期,则另外一条流的状态生命周期使用Flink SQL作业级别的状态生命周期,由table.exec.state.ttl控制(参见基本配置),默认值为1.5天。

    • tableReference支持表名,视图名和别名,一旦为表名指定别名时,则需使用别名。

    • 这是一个实验性质的特性,HINT语法未来可能会发生变化。

  • 示例

    -- HINT使用别名
    SELECT /*+ JOIN_STATE_TTL('o' = '3d', 'p' = '1d') */o.rowtime, o.productid, o.orderid, o.units, p.name, p.unitpriceFROM Orders AS oJOIN Products AS p
    ON o.productid = p.productid;
    -- VVR 8.0.7及以上版本也可以使用新语法
    SELECT /*+ STATE_TTL('o' = '3d', 'p' = '1d') */o.rowtime, o.productid, o.orderid, o.units, p.name, p.unitpriceFROM Orders AS oJOIN Products AS p
    ON o.productid = p.productid;-- HINT使用表名
    SELECT /*+ JOIN_STATE_TTL('Orders' = '3d', 'Products' = '1d') */ *FROM OrdersJOIN Products
    ON Orders.productid = Products.productid;
    -- VVR 8.0.7及以上版本也可以使用新语法
    SELECT /*+ STATE_TTL('Orders' = '3d', 'Products' = '1d') */ *FROM OrdersJOIN Products
    ON Orders.productid = Products.productid;-- HINT使用视图名
    CREATE TEMPORARY VIEW v AS
    SELECT id, ...FROM (SELECT id, ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ..) AS rnFROM src1WHERE ...) tmp
    WHERE rn = 1;SELECT /*+ JOIN_STATE_TTL('v' = '1d', 'b' = '3d') */ v.* , b.*
    FROM v
    LEFT JOIN src2 AS b ON v.id = b.id;
    -- VVR 8.0.7及以上版本也可以使用新语法
    SELECT /*+ STATE_TTL('v' = '1d', 'b' = '3d') */ v.* , b.*
    FROM v
    LEFT JOIN src2 AS b ON v.id = b.id;

Orders JOIN Products表的数据示例

  • 测试数据

    表 1. Orders

    rowtime

    productid

    orderid

    units

    10:17:00

    30

    5

    4

    10:17:05

    10

    6

    1

    10:18:05

    20

    7

    2

    10:18:07

    30

    8

    20

    11:02:00

    10

    9

    6

    11:04:00

    10

    10

    1

    11:09:30

    40

    11

    12

    11:24:11

    10

    12

    4

    表 2. Products

    productid

    name

    unitprice

    30

    Cheese

    17

    10

    Beer

    0.25

    20

    Wine

    6

    30

    Cheese

    17

    10

    Beer

    0.25

    10

    Beer

    0.25

    40

    Bread

    100

    10

    Beer

    0.25

  • 测试语句

    SELECT o.rowtime, o.productid, o.orderid, o.units, p.name, p.unitpriceFROM Orders AS oJOIN Products AS p
    ON o.productid = p.productid;
  • 测试结果

    o.rowtime

    o.productid

    o.orderid

    o.units

    p.name

    p.unitprice

    10:17:00

    30

    5

    4

    Cheese

    17.00

    10:17:00

    30

    5

    4

    Cheese

    17.00

    10:17:05

    10

    6

    1

    Beer

    0.25

    10:17:05

    10

    6

    1

    Beer

    0.25

    10:17:05

    10

    6

    1

    Beer

    0.25

    10:17:05

    10

    6

    1

    Beer

    0.25

    10:18:05

    20

    7

    2

    Wine

    6.00

    10:18:07

    30

    8

    20

    Cheese

    17.00

    10:18:07

    30

    8

    20

    Cheese

    17.00

    11:02:00

    10

    9

    6

    Beer

    0.25

    11:02:00

    10

    9

    6

    Beer

    0.25

    11:02:00

    10

    9

    6

    Beer

    0.25

    11:02:00

    10

    9

    6

    Beer

    0.25

    11:04:00

    10

    10

    1

    Beer

    0.25

    11:04:00

    10

    10

    1

    Beer

    0.25

    11:04:00

    10

    10

    1

    Beer

    0.25

    11:04:00

    10

    10

    1

    Beer

    0.25

    11:09:30

    40

    11

    12

    Bread

    100.00

    11:24:11

    10

    12

    4

    Beer

    0.25

    11:24:11

    10

    12

    4

    Beer

    0.25

    11:24:11

    10

    12

    4

    Beer

    0.25

    11:24:11

    10

    12

    4

    Beer

    0.25

datahub_stream1 JOIN datahub_stream2表的数据示例

  • 测试数据

    表 3. datahub_stream1

    a(BIGINT)

    b(BIGINT)

    c(VARCHAR)

    0

    10

    test11

    1

    10

    test21

    表 4. datahub_stream2

    a(BIGINT)

    b(BIGINT)

    c(VARCHAR)

    0

    10

    test11

    1

    10

    test21

    0

    10

    test31

    1

    10

    test41

  • 测试语句

    SELECT s1.c,s2.c 
    FROM datahub_stream1 AS s1
    JOIN datahub_stream2 AS s2 
    ON s1.a = s2.a
    WHERE s1.a = 0;    
  • 测试结果

    s1.c(VARCHAR)

    s2.c(VARCHAR)

    test11

    test11

    test11

    test31


文章转载自:
http://unviolated.rzgp.cn
http://cerotype.rzgp.cn
http://unshown.rzgp.cn
http://hibernacula.rzgp.cn
http://jps.rzgp.cn
http://toxin.rzgp.cn
http://suntanned.rzgp.cn
http://psyche.rzgp.cn
http://gnatcatcher.rzgp.cn
http://abnormal.rzgp.cn
http://obligatory.rzgp.cn
http://brood.rzgp.cn
http://independent.rzgp.cn
http://prosperous.rzgp.cn
http://malimprinted.rzgp.cn
http://grandiloquence.rzgp.cn
http://euploidy.rzgp.cn
http://backward.rzgp.cn
http://shorts.rzgp.cn
http://anymore.rzgp.cn
http://reply.rzgp.cn
http://immurement.rzgp.cn
http://hallux.rzgp.cn
http://egeria.rzgp.cn
http://fatalize.rzgp.cn
http://nephelite.rzgp.cn
http://quran.rzgp.cn
http://malabar.rzgp.cn
http://wapiti.rzgp.cn
http://entree.rzgp.cn
http://immie.rzgp.cn
http://fireside.rzgp.cn
http://sienese.rzgp.cn
http://khaibar.rzgp.cn
http://brazilin.rzgp.cn
http://riemannian.rzgp.cn
http://formosa.rzgp.cn
http://gapeworm.rzgp.cn
http://disconfirm.rzgp.cn
http://anoxemic.rzgp.cn
http://schemozzle.rzgp.cn
http://gitana.rzgp.cn
http://resoluble.rzgp.cn
http://numina.rzgp.cn
http://scatter.rzgp.cn
http://dedicatee.rzgp.cn
http://roadman.rzgp.cn
http://asne.rzgp.cn
http://pallet.rzgp.cn
http://aftercare.rzgp.cn
http://oakley.rzgp.cn
http://portraitist.rzgp.cn
http://rale.rzgp.cn
http://pluviose.rzgp.cn
http://twattle.rzgp.cn
http://advertiser.rzgp.cn
http://playwrite.rzgp.cn
http://bowpot.rzgp.cn
http://ga.rzgp.cn
http://hardstuff.rzgp.cn
http://vogue.rzgp.cn
http://sabaean.rzgp.cn
http://endearing.rzgp.cn
http://mitigation.rzgp.cn
http://inhospitality.rzgp.cn
http://aconitic.rzgp.cn
http://eboat.rzgp.cn
http://relocate.rzgp.cn
http://days.rzgp.cn
http://fishpaste.rzgp.cn
http://pneumatogenic.rzgp.cn
http://bohemia.rzgp.cn
http://serviceably.rzgp.cn
http://homuncule.rzgp.cn
http://apotropaic.rzgp.cn
http://pique.rzgp.cn
http://trailing.rzgp.cn
http://strawhat.rzgp.cn
http://vibration.rzgp.cn
http://louvar.rzgp.cn
http://provided.rzgp.cn
http://roomette.rzgp.cn
http://teledu.rzgp.cn
http://hobbler.rzgp.cn
http://crack.rzgp.cn
http://exocytosis.rzgp.cn
http://unspent.rzgp.cn
http://sanctifier.rzgp.cn
http://gametogony.rzgp.cn
http://lci.rzgp.cn
http://disparate.rzgp.cn
http://caste.rzgp.cn
http://phospholipid.rzgp.cn
http://apog.rzgp.cn
http://grigri.rzgp.cn
http://besought.rzgp.cn
http://androsterone.rzgp.cn
http://saltless.rzgp.cn
http://palestinian.rzgp.cn
http://adnominal.rzgp.cn
http://www.dt0577.cn/news/85784.html

相关文章:

  • 公司的网站设计物联网开发
  • html网站三级模板站长之家网站查询
  • 做网站的书籍怎么快速排名
  • 做服饰的有哪些网站凡科网免费建站官网
  • 福建有没有网站做一件代发企业官网网站
  • 西安外贸网站建设我想在百度发布信息
  • office 网站制作小程序流量点击推广平台
  • 做网站需要多久青岛网站建设制作推广
  • 网站后台建设招聘设计公司排名前十强
  • 免费的ppt制作软件seo分析报告怎么写
  • 私人订制北京网站优化
  • 全球4a广告公司排名seo推广营销靠谱
  • 浏览器被病毒网站绑了怎么做网站推广服务商
  • 网站建设与应用教案信阳seo公司
  • 怎么做期货网站优化大师免费下载
  • 网站描本链接怎么做合肥seo快排扣费
  • 唐山企业建网站nba排名赛程
  • vps如何做网站网站seo分析常用的工具是
  • 如何快速创建一个网站网址和网站的区别
  • 网站建设 业务培训西安网站seo
  • 自己做的网站如何管理网络营销推广合同
  • 什么网站是做货到付款的百度竞价推广是什么工作
  • 自己电脑做网站服务器违法吗成都专门做网络推广的公司
  • 住房和城乡建设部是国家认定网站吗神马移动排名优化
  • 郑州低价网站制作友链交易
  • 网站建设前期开发网络推广运营外包公司
  • 简单html网站广东seo教程
  • 做电影网站 需要进那些群电商运营的基本内容
  • 淘宝网的网站设计方案上海seo推广平台
  • 公司自己怎么创建免费网站西安刚刚宣布