PiflowX-组件UnionAll

本文介绍了PiflowX中基于Flink的UnionAll组件,用于合并多个输入源的CSV数据,通过示例配置展示了如何配置和使用该组件实现数据融合及最终展示。
摘要由CSDN通过智能技术生成

UnionAll组件

组件说明

Union多个输入源。输入源必须具有相同的字段类型。

计算引擎

flink

组件分组

common

端口

Inport:Any

outport:默认端口

组件属性

名称展示名称默认值允许值是否必填描述例子
inportsInports“”Inports string are separated by commas。1,2

UnionAll示例配置

{
  "flow": {
    "uuid": "7a5d97d288224a358a2d30ae8a229230",
    "runMode": "DEBUG",
    "name": "UnionAllTest",
    "engineType": "flink",
    "environment": {
      "runtimeMode": "batch"
    },
    "paths": [
      {
        "inport": "1",
        "from": "CsvStringParser1",
        "to": "UnionAll",
        "outport": ""
      },
      {
        "inport": "2",
        "from": "CsvStringParser2",
        "to": "UnionAll",
        "outport": ""
      },
      {
        "inport": "",
        "from": "UnionAll",
        "to": "ShowData",
        "outport": ""
      }
    ],
    "stops": [
      {
        "uuid": "0000",
        "name": "CsvStringParser1",
        "bundle": "cn.piflow.bundle.flink.file.CsvStringParser",
        "properties": {
          "content": "1,zs\n2,ls",
          "delimiter": ",",
          "schema": "id:int,name:string"
        }
      },
      {
        "uuid": "0000",
        "name": "CsvStringParser2",
        "bundle": "cn.piflow.bundle.flink.file.CsvStringParser",
        "properties": {
          "content": "1,zs\n3,ww",
          "delimiter": ",",
          "schema": "id:int,name:string"
        }
      },
      {
        "customizedProperties": {},
        "name": "UnionAll",
        "uuid": "0f0cf231dbf64852b17ac3ee2064134d",
        "bundle": "cn.piflow.bundle.flink.common.UnionAll",
        "properties": {
          "inports": "1,2"
        }
      },
      {
        "customizedProperties": {},
        "name": "ShowData",
        "uuid": "c2a84707d76b4083a74e46e6ea8cd5e3",
        "bundle": "cn.piflow.bundle.flink.common.ShowData",
        "properties": {
          "showNumber": "1000"
        }
      }
    ]
  }
}
示例说明

1.通过两个CsvStringParser组件解析字符串类型的csv数据;

2.使用UnionAll组件将2个数据源的数据连接起来;

3.使用ShowData组件将union后的数据打印在控制台。

演示DEMO

PiflowX组件-UnionAll

请添加图片描述

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值