Skip to main content
Version: 2.3.10

Console

Console sink connector

Support Connector Version

  • All versions

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Description

Used to send data to Console. Both support streaming and batch mode.

For example, if the data from upstream is [age: 12, name: jared], the content send to console is the following: {"name":"jared","age":17}

Key Features

Options

NameTypeRequiredDefaultDescription
common-optionsNo-Sink plugin common parameters, please refer to Sink Common Options for details
log.print.databooleanNo-Flag to determine whether data should be printed in the logs. The default value is true
log.print.delay.msintNo-Delay in milliseconds between printing each data item to the logs. The default value is 0.

Task Example

Simple:

This is a randomly generated data, written to the console, with a degree of parallelism of 1

env {
parallelism = 1
job.mode = "STREAMING"
}

source {
FakeSource {
plugin_output = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}

sink {
Console {
plugin_input = "fake"
}
}

Multiple Sources Simple:

This is a multiple source and you can specify a data source to write to the specified end

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"
}
}

Console Sample Data

This is a printout from our console

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

Changelog

Change Log
ChangeCommitVersion
[improve] console sink options (#8743)https://github.com/apache/seatunnel/commit/c439b99f12.3.10
[Improve] restruct connector common options (#8634)https://github.com/apache/seatunnel/commit/f3499a6ee2.3.10
[Improve][dist]add UT class name check (#8182)https://github.com/apache/seatunnel/commit/9cf4192fe2.3.9
[Feature][Core] Support cdc task ddl restore for zeta (#7463)https://github.com/apache/seatunnel/commit/8e322281e2.3.9
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d032.3.9
[Feature][Core] Add event notify for all connector (#7501)https://github.com/apache/seatunnel/commit/d71337b0e2.3.8
[Improve][Connector] Add multi-table sink option check (#7360)https://github.com/apache/seatunnel/commit/2489f64462.3.7
Update ConsoleSinkFactory.java (#7350)https://github.com/apache/seatunnel/commit/9216627222.3.7
[Feature][Core] Support using upstream table placeholders in sink options and auto replacement (#7131)https://github.com/apache/seatunnel/commit/c4ca741222.3.6
[Feature][Core] Support event listener for job (#6419)https://github.com/apache/seatunnel/commit/831d0022e2.3.5
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de7408102.3.4
[Improve] Add default implement for SeaTunnelSink::setTypeInfo (#5682)https://github.com/apache/seatunnel/commit/86cba87452.3.4
[Feature] Support multi-table sink (#5620)https://github.com/apache/seatunnel/commit/81ac173182.3.4
[Improve] Refactor CatalogTable and add SeaTunnelSource::getProducedCatalogTables (#5562)https://github.com/apache/seatunnel/commit/41173357f2.3.4
[Feature][api env] Add job-level configuration for checkpoint timeout. (#5222)https://github.com/apache/seatunnel/commit/3c13275ed2.3.4
[Improve][CheckStyle] Remove useless 'SuppressWarnings' annotation of checkstyle. (#5260)https://github.com/apache/seatunnel/commit/51c0d709b2.3.4
[Feature][CDC][Zeta] Support schema evolution framework(DDL) (#5125)https://github.com/apache/seatunnel/commit/4f89c1d272.3.3
Merge branch 'dev' into merge/cdchttps://github.com/apache/seatunnel/commit/4324ee1912.3.1
[Improve][Project] Code format with spotless plugin.https://github.com/apache/seatunnel/commit/423b583032.3.1
[hotfix][zeta] fix zeta multi-table parser error (#4193)https://github.com/apache/seatunnel/commit/98f2ad0c12.3.1
[Feature][Zeta] Support shuffle multiple rows by tableId (#4147)https://github.com/apache/seatunnel/commit/8348f1a102.3.1
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd601052.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab166562.3.1
[Improve][Connector-V2]console sink output content to slf4j log (#3745)https://github.com/apache/seatunnel/commit/82a5c852d2.3.1
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a112.3.0
[improve][connector] The Factory#factoryIdentifier must be consistent with PluginIdentifierInterface#getPluginName (#3328)https://github.com/apache/seatunnel/commit/d9519d6962.3.0
[Improve][Connector-V2][Console] Add Console option rule (#3322)https://github.com/apache/seatunnel/commit/efb4711602.3.0
[Improve][connector][console] print subtask index (#3000)https://github.com/apache/seatunnel/commit/de345783d2.3.0-beta
[Bug][Connector-V2] Fix the bug that can not print SeaTunnelRow correctly (#2749)https://github.com/apache/seatunnel/commit/9365d35202.2.0-beta
[Feature][Connector-V2] Add iceberg source connector (#2615)https://github.com/apache/seatunnel/commit/ffc6088a72.2.0-beta
[Bug][ConsoleSinkV2]fix fieldToString StackOverflow and add Unit-Test (#2545)https://github.com/apache/seatunnel/commit/6f87094562.2.0-beta
[Improve][Console] improve console to printf schema and deepToString fields (#2517)https://github.com/apache/seatunnel/commit/963387d372.2.0-beta
[api-draft][Optimize] Optimize module name (#2062)https://github.com/apache/seatunnel/commit/f79e3112b2.2.0-beta