Console
Console 数据接收器
支持连接器版本
- 所有版本
支持的引擎
Spark
Flink
SeaTunnel Zeta
描述
接收Source端传入的数据并打印到控制台。支持批同步和流同步两种模式。
例如,来自上游的数据为 [
age: 12, name: jared
] ,则发送到控制台的内容为:{"name":"jared","age":17}
主要特性
接收器选项
名称 | 类型 | 是否必须 | 默认值 | 描述 |
---|---|---|---|---|
common-options | 否 | - | Sink插件常用参数,请参考 Sink常用选项 了解详情 | |
log.print.data | boolean | 否 | - | 确定是否应在日志中打印数据的标志。默认值为true |
log.print.delay.ms | int | 否 | - | 将每个数据项打印到日志之间的延迟(以毫秒为单位)。默认值为0 |
任务示例
简单示例:
随机生成的数据,包含两个字段,即
name
(字符串类型)和age
(整型),写入控制台,并行度为1
env {
parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
plugin_output = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Console {
plugin_input = "fake"
}
}
多数据源示例:
多数据源示例,通过配置可以指定数据源写入指定接收器
env {
parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
plugin_output = "fake1"
schema = {
fields {
id = "int"
name = "string"
age = "int"
sex = "string"
}
}
}
FakeSource {
plugin_output = "fake2"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Console {
plugin_input = "fake1"
}
Console {
plugin_input = "fake2"
}
}
控制台示例数据
控制台打印的输出:
2022-12-19 11:01:45,417 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - output rowType: name<STRING>, age<INT>
2022-12-19 11:01:46,489 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=1: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: CpiOd, 8520946
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=2: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: eQqTs, 1256802974
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=3: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: UsRgO, 2053193072
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=4: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: jDQJj, 1993016602
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=5: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: rqdKp, 1392682764
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=6: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: wCoWN, 986999925
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=7: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: qomTU, 72775247
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=8: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: jcqXR, 1074529204
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=9: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: AkWIO, 1961723427
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=10: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: hBoib, 929089763
变更日志
Change Log
Change | Commit | Version |
---|---|---|
[improve] console sink options (#8743) | https://github.com/apache/seatunnel/commit/c439b99f1 | 2.3.10 |
[Improve] restruct connector common options (#8634) | https://github.com/apache/seatunnel/commit/f3499a6ee | 2.3.10 |
[Improve][dist]add UT class name check (#8182) | https://github.com/apache/seatunnel/commit/9cf4192fe | 2.3.9 |
[Feature][Core] Support cdc task ddl restore for zeta (#7463) | https://github.com/apache/seatunnel/commit/8e322281e | 2.3.9 |
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786) | https://github.com/apache/seatunnel/commit/6b7c53d03 | 2.3.9 |
[Feature][Core] Add event notify for all connector (#7501) | https://github.com/apache/seatunnel/commit/d71337b0e | 2.3.8 |
[Improve][Connector] Add multi-table sink option check (#7360) | https://github.com/apache/seatunnel/commit/2489f6446 | 2.3.7 |
Update ConsoleSinkFactory.java (#7350) | https://github.com/apache/seatunnel/commit/921662722 | 2.3.7 |
[Feature][Core] Support using upstream table placeholders in sink options and auto replacement (#7131) | https://github.com/apache/seatunnel/commit/c4ca74122 | 2.3.6 |
[Feature][Core] Support event listener for job (#6419) | https://github.com/apache/seatunnel/commit/831d0022e | 2.3.5 |
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755) | https://github.com/apache/seatunnel/commit/8de740810 | 2.3.4 |
[Improve] Add default implement for SeaTunnelSink::setTypeInfo (#5682) | https://github.com/apache/seatunnel/commit/86cba8745 | 2.3.4 |
[Feature] Support multi-table sink (#5620) | https://github.com/apache/seatunnel/commit/81ac17318 | 2.3.4 |
[Improve] Refactor CatalogTable and add SeaTunnelSource::getProducedCatalogTables (#5562) | https://github.com/apache/seatunnel/commit/41173357f | 2.3.4 |
[Feature][api env] Add job-level configuration for checkpoint timeout. (#5222) | https://github.com/apache/seatunnel/commit/3c13275ed | 2.3.4 |
[Improve][CheckStyle] Remove useless 'SuppressWarnings' annotation of checkstyle. (#5260) | https://github.com/apache/seatunnel/commit/51c0d709b | 2.3.4 |
[Feature][CDC][Zeta] Support schema evolution framework(DDL) (#5125) | https://github.com/apache/seatunnel/commit/4f89c1d27 | 2.3.3 |
Merge branch 'dev' into merge/cdc | https://github.com/apache/seatunnel/commit/4324ee191 | 2.3.1 |
[Improve][Project] Code format with spotless plugin. | https://github.com/apache/seatunnel/commit/423b58303 | 2.3.1 |
[hotfix][zeta] fix zeta multi-table parser error (#4193) | https://github.com/apache/seatunnel/commit/98f2ad0c1 | 2.3.1 |
[Feature][Zeta] Support shuffle multiple rows by tableId (#4147) | https://github.com/apache/seatunnel/commit/8348f1a10 | 2.3.1 |
[Improve][build] Give the maven module a human readable name (#4114) | https://github.com/apache/seatunnel/commit/d7cd60105 | 2.3.1 |
[Improve][Project] Code format with spotless plugin. (#4101) | https://github.com/apache/seatunnel/commit/a2ab16656 | 2.3.1 |
[Improve][Connector-V2]console sink output content to slf4j log (#3745) | https://github.com/apache/seatunnel/commit/82a5c852d | 2.3.1 |
[Hotfix][OptionRule] Fix option rule about all connectors (#3592) | https://github.com/apache/seatunnel/commit/226dc6a11 | 2.3.0 |
[improve][connector] The Factory#factoryIdentifier must be consistent with PluginIdentifierInterface#getPluginName (#3328) | https://github.com/apache/seatunnel/commit/d9519d696 | 2.3.0 |
[Improve][Connector-V2][Console] Add Console option rule (#3322) | https://github.com/apache/seatunnel/commit/efb471160 | 2.3.0 |
[Improve][connector][console] print subtask index (#3000) | https://github.com/apache/seatunnel/commit/de345783d | 2.3.0-beta |
[Bug][Connector-V2] Fix the bug that can not print SeaTunnelRow correctly (#2749) | https://github.com/apache/seatunnel/commit/9365d3520 | 2.2.0-beta |
[Feature][Connector-V2] Add iceberg source connector (#2615) | https://github.com/apache/seatunnel/commit/ffc6088a7 | 2.2.0-beta |
[Bug][ConsoleSinkV2]fix fieldToString StackOverflow and add Unit-Test (#2545) | https://github.com/apache/seatunnel/commit/6f8709456 | 2.2.0-beta |
[Improve][Console] improve console to printf schema and deepToString fields (#2517) | https://github.com/apache/seatunnel/commit/963387d37 | 2.2.0-beta |
[api-draft][Optimize] Optimize module name (#2062) | https://github.com/apache/seatunnel/commit/f79e3112b | 2.2.0-beta |