EricJoy2048 commented on code in PR #2822:
URL:
https://github.com/apache/incubator-seatunnel/pull/2822#discussion_r975964509
##########
docs/en/connector-v2/sink/Console.md:
##########
@@ -0,0 +1,70 @@
+# Console
+
+> Console sink connector
+
+## 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
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [schema projection](../../concept/connector-v2-features.md)
+
+## Options
+
+| name | type | required | default value |
+| --- |--------|----------|---------------|
+## Example
+
+simple:
+
+```hocon
+Console {
+
+ }
+```
+
+test:
+
+* Configuring the SeaTunnel config file
+
+```hocon
+env {
+ execution.parallelism = 1
+ job.mode = "STREAMING"
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ name = "string"
+ age = "int"
+ }
+ }
+ }
+}
+
+transform {
+ sql = "select name, age from fake"
+}
+
+sink {
+ Console {
+
+ }
+}
+
+```
+
+* Start a SeaTunnel task
+
+
+* Console print data
+
+```text
+{"name":"jared","age":17}
Review Comment:
I delete the `sql = "select name, age from fake"` and test again, the result
data format is
```
fields : name, age
types : STRING, INT
row=1 : kTIgqEnmek, 1995767708
row=2 : XiBgErvEIH, 512006690
row=3 : XzhptTYBFJ, 1580965094
row=4 : TaPODkPfbr, 906352196
row=5 : RikifKdMYV, 1160742148
row=6 : dYiyuLirga, 267550983
row=7 : gnuOXNQOSb, 1343626802
row=8 : UHlkfrpBLZ, 1382683507
row=9 : rEwNHxFpsT, 318461297
row=10 : SpbedVNWhn, 1569444335
row=11 : lZFPAUIUfD, 604436234
row=12 : hCqsxYwsZD, 927394063
row=13 : ICMhzlNAvR, 215012519
row=14 : vpAuOWSzHU, 358369980
row=15 : fxuMpUpGUA, 477071172
row=16 : fnZapRDDcU, 767283150
row=17 : MHbLMHEyAp, 165111884
row=18 : ImBiQdRuAa, 1122842860
row=19 : toRrexyiTx, 1383579467
row=20 : kkJfUmGgCN, 1904226574
row=21 : DyNDkMWrdC, 18456794
row=22 : kRMJMYmNmW, 1314673824
row=23 : ffLWtlKbep, 1422679907
row=24 : EUfjFHkYnj, 1100063222
row=25 : ZwUhKrgBpc, 885374895
row=26 : JGeJvSyDZX, 333513288
row=27 : kVqfneFuUe, 1494395147
row=28 : kmefehwNxd, 1647081002
```
##########
docs/en/connector-v2/sink/Console.md:
##########
@@ -0,0 +1,70 @@
+# Console
+
+> Console sink connector
+
+## 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
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [schema projection](../../concept/connector-v2-features.md)
+
+## Options
+
+| name | type | required | default value |
+| --- |--------|----------|---------------|
+## Example
+
+simple:
+
+```hocon
+Console {
+
+ }
+```
+
+test:
+
+* Configuring the SeaTunnel config file
+
+```hocon
+env {
+ execution.parallelism = 1
+ job.mode = "STREAMING"
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ name = "string"
+ age = "int"
+ }
+ }
+ }
+}
+
+transform {
+ sql = "select name, age from fake"
Review Comment:
Do you test this example config? I test it on spark and found error. I am
not sure if this is a bug. @ashulin @Hisoka-X
This is the error logs:
```
22/09/21 09:50:48 ERROR command.SparkApiTaskExecuteCommand: Run SeaTunnel on
spark failed.
org.apache.seatunnel.shade.com.typesafe.config.ConfigException$WrongType:
../config/flink_fake_console.conf: 17: transform has type list of STRING rather
than list of OBJECT
at
org.apache.seatunnel.shade.com.typesafe.config.impl.SimpleConfig.getHomogeneousWrappedList(SimpleConfig.java:452)
at
org.apache.seatunnel.shade.com.typesafe.config.impl.SimpleConfig.getObjectList(SimpleConfig.java:460)
at
org.apache.seatunnel.shade.com.typesafe.config.impl.SimpleConfig.getConfigList(SimpleConfig.java:465)
at
org.apache.seatunnel.core.starter.spark.execution.SparkExecution.<init>(SparkExecution.java:49)
at
org.apache.seatunnel.core.starter.spark.command.SparkApiTaskExecuteCommand.execute(SparkApiTaskExecuteCommand.java:53)
at org.apache.seatunnel.core.starter.Seatunnel.run(Seatunnel.java:40)
at
org.apache.seatunnel.core.starter.spark.SeatunnelSpark.main(SeatunnelSpark.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
at
org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:849)
at
org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:167)
at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:195)
at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
at
org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:924)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:933)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]