JustinMars1 opened a new issue #1024:
URL: https://github.com/apache/incubator-seatunnel/issues/1024


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   解析kafka数据写入mysql失败但未打印错误信息
   1.MySQL建表语句(test数据库)
   CREATE TABLE `nn` (
     `id` int(11) DEFAULT NULL,
     `name` varchar(255) DEFAULT NULL,
     `created` date DEFAULT NULL,
     `modified` date DEFAULT NULL,
     `yn` int(11) DEFAULT NULL
   );
   2.创建kafka生产者,生产信息如下
   >1,justin
   >2.mars
   3.使用打印信息的方式数据是显示的
   如
   sink {
     console {}
   }
   输出信息如下
   +---+------+
   |id |name  |
   +---+------+
   |1  |justin|
   +---+------+
   4.使用mysql配置信息,未写入数据库,也为打印错误日志
   
   
   ### SeaTunnel Version
   
   waterdrop-dist-2.0.4-2.11.8
   
   ### SeaTunnel Config
   
   ```conf
   env {
     # seatunnel defined streaming batch duration in seconds
     spark.streaming.batchDuration = 5
   
     spark.app.name = "seatunnel"
     spark.ui.port = 13000
   }
   
   source {
     kafkaStream {
       topics = "seatunnel"
       consumer.bootstrap.servers = "bigdata2:9092"
       consumer.group.id = "seatunnel_group_mysql1"
       auto.offset.reset = "latest"
      }
   }
   
   transform {
     split {
       source_field = "raw_message"
       delimiter = ","
       fields = ["id","name"]
       result_table_name = "mars"
     }
     sql {
       sql = "select id,name from mars",
       table_name = "mars"
     }
   }
   
   sink {
     Mysql {
       save_mode = "update",
       truncate = true,
       url = "jdbc:mysql://ip:3306/test",
       user= "root",
       password = "*****",
       dbtable = "mars",
       customUpdateStmt = "INSERT INTO test.nn (id, name, created, modified, 
yn) values(?, ?, now(), now(), 1) ON DUPLICATE KEY UPDATE id = IFNULL(VALUES 
(id), id), name = IFNULL(VALUES (name), name)"
   }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   ./bin/start-waterdrop-spark.sh --master local[4] --deploy-mode client 
--config ./config/sparkkafkamysql.conf
   ```
   
   
   ### Error Exception
   
   ```log
   未打印错误信息,但也为写入mysql数据库
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   jdk 1.8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]


Reply via email to