aiyougit opened a new issue, #8855:
URL: https://github.com/apache/seatunnel/issues/8855

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
    If the destination is DM, the error type conversion fails when the Source 
field is empty.
   
   log:
   
   2025-02-27 09:35:05,500 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - 
Exception 
StackTrace:org.apache.seatunnel.core.starter.exception.CommandExecuteException: 
SeaTunnel job executed failed
        at 
org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:213)
        at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
        at 
org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:34)
   Caused by: 
org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: 
java.lang.RuntimeException: java.lang.RuntimeException: 
java.util.concurrent.ExecutionException: 
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException:
 ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error 
field:create_user
        at 
org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:253)
        at 
org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:66)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTransformCollector.collect(SeaTunnelTransformCollector.java:39)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTransformCollector.collect(SeaTunnelTransformCollector.java:27)
        at 
org.apache.seatunnel.engine.server.task.group.queue.IntermediateBlockingQueue.handleRecord(IntermediateBlockingQueue.java:70)
        at 
org.apache.seatunnel.engine.server.task.group.queue.IntermediateBlockingQueue.collect(IntermediateBlockingQueue.java:50)
        at 
org.apache.seatunnel.engine.server.task.flow.IntermediateQueueFlowLifeCycle.collect(IntermediateQueueFlowLifeCycle.java:51)
        at 
org.apache.seatunnel.engine.server.task.TransformSeaTunnelTask.collect(TransformSeaTunnelTask.java:73)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:168)
        at 
org.apache.seatunnel.engine.server.task.TransformSeaTunnelTask.call(TransformSeaTunnelTask.java:78)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:693)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1018)
        at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:39)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
   Caused by: java.lang.RuntimeException: 
java.util.concurrent.ExecutionException: 
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException:
 ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error 
field:create_user
        at 
org.apache.seatunnel.api.sink.multitablesink.MultiTableSinkWriter.prepareCommit(MultiTableSinkWriter.java:258)
        at 
org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:188)
        ... 17 more
   Caused by: java.util.concurrent.ExecutionException: 
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException:
 ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error 
field:create_user
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at 
org.apache.seatunnel.api.sink.multitablesink.MultiTableSinkWriter.prepareCommit(MultiTableSinkWriter.java:256)
        ... 18 more
   Caused by: 
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException:
 ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error 
field:create_user
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:275)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:45)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:31)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferedBatchStatementExecutor.executeBatch(BufferedBatchStatementExecutor.java:51)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.attemptFlush(JdbcOutputFormat.java:172)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:136)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.prepareCommit(JdbcSinkWriter.java:131)
        at 
org.apache.seatunnel.api.sink.multitablesink.MultiTableSinkWriter.lambda$prepareCommit$4(MultiTableSinkWriter.java:241)
        ... 6 more
   Caused by: dm.jdbc.driver.DMException: Data convertion error
        at dm.jdbc.driver.DBError.throwException(DBError.java:679)
        at dm.jdbc.a.b.a(J2DB.java:438)
        at 
dm.jdbc.driver.DmdbPreparedStatement.do_setString(DmdbPreparedStatement.java:719)
        at 
dm.jdbc.driver.DmdbPreparedStatement.setString(DmdbPreparedStatement.java:1559)
        at 
org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setString(HikariProxyPreparedStatement.java)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.setString(FieldNamedPreparedStatement.java:126)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:202)
        ... 13 more
   
        at 
org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:205)
        ... 2 more
    
   
   
   
   
   ### SeaTunnel Version
   
   2.3.8
   
   ### SeaTunnel Config
   
   ```conf
   {
       "sink" : [
           {
               "password": "***",
               "batch_size" : 1024,
               "driver" : "dm.jdbc.driver.DmDriver",
               "query" : "MERGE INTO SYSDBA.XHY_DM_TARGET target USING (SELECT 
? AS USER_ID,? AS USERNAME,? AS CREATE_USER,? AS EMAIL1,? AS STATUS,? AS 
DEPT_ID,? AS DEL_FLAG) source ON (target.USER_ID = source.USER_ID) WHEN NOT 
MATCHED THEN INSERT 
(USER_ID,USERNAME,CREATE_USER,EMAIL1,STATUS,DEPT_ID,DEL_FLAG) VALUES 
(source.USER_ID,source.USERNAME,source.CREATE_USER,source.EMAIL1,source.STATUS,source.DEPT_ID,source.DEL_FLAG)",
               "plugin_name" : "Jdbc",
               "user" : "sysdba",
               "url" : "jdbc:dm://xxxx/xxxx"
           }
       ],
       "source" : [
           {
               "password": "***",
               "driver" : "com.mysql.cj.jdbc.Driver",
               "query" : "select 
user_id,username,create_user,email1,status,dept_id,del_flag from 
sjzt.sys_user_tmp",
               "plugin_name" : "Jdbc",
               "user" : "hxsjzt",
               "url" : 
"jdbc:mysql://xxxxx/xxxx?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"
           }
       ],
       "env" : {
           "job.mode" : "BATCH",
           "execution.parallelism" : 1
       }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./seatunnel.sh --config xxx.json
   ```
   
   ### Error Exception
   
   ```log
   xxx
   ```
   
   ### Zeta or Flink or Spark Version
   
   zeta
   
   ### Java or Scala Version
   
   java8
   
   ### 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