You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "inuex (via GitHub)" <gi...@apache.org> on 2024/08/16 07:34:02 UTC

[I] [Bug] [JDBC] ORA-01461 [seatunnel]

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

   ### 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
   
   同步时发生错误 ORA-01461,看日志发现使用了 MERGE INTO语句,有个字段是CLOB列
   
   执行脚本
   ```
   env {
     parallelism = 8
     job.mode = "BATCH"
   }
   
   source {
     Jdbc {
       url = "jdbc:oracle:thin:@127.0.0.1:1521:XE"
       driver = "oracle.jdbc.OracleDriver"
       connection_check_timeout_sec = 100
       user = "test"
       password = "test"
       query = "select * from TEST.LOG"
       fetch_size = 500
     }
   }
   
   sink {
     jdbc {
       url = "jdbc:oracle:thin:@127.0.0.1:1521:XE"
       driver = "oracle.jdbc.OracleDriver"
       connection_check_timeout_sec = 100
       user = "test"
       password = "test"
       database = XE
       table = "TEST.LOG_1"
       generate_sink_sql = true
       support_upsert_by_query_primary_key_exist = true
       primary_keys = ["ID"]
     }
   }
   ```
   
   日志SQL截图
   ```
   merge into "TEST"."LOG_1" target using
       (select ? "ID",
               ? "API_CODE",
               ? "DATA"
        from dual) source on (target."ID"=source."ID") when matched then
   update
   set target."API_CODE"=source."API_CODE",
       target."DATA"=source."DATA" when not matched then
   insert ("ID",
           "API_CODE",
           "DATA")
   values (source."ID",
           source."API_CODE",
           source."DATA")
   ```
   
   报错信息
   ```
   Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed
           at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:211)
           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:[COMMON-10], ErrorDescription:[Flush data operation that in sink connector failed]
           at org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:292)
           at org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:74)
           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:703)
           at org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1021)
           at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
           at java.util.concurrent.FutureTask.run(Unknown Source)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
   Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-10], ErrorDescription:[Flush data operation that in sink connector failed]
           at org.apache.seatunnel.api.sink.multitablesink.MultiTableSinkWriter.prepareCommit(MultiTableSinkWriter.java:234)
           at org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:208)
           ... 16 more
   Caused by: java.util.concurrent.ExecutionException: org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-10], ErrorDescription:[Flush data operation that in sink connector failed]
           at java.util.concurrent.FutureTask.report(Unknown Source)
           at java.util.concurrent.FutureTask.get(Unknown Source)
           at org.apache.seatunnel.api.sink.multitablesink.MultiTableSinkWriter.prepareCommit(MultiTableSinkWriter.java:232)
           ... 17 more
   Caused by: org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-10], ErrorDescription:[Flush data operation that in sink connector failed]
           at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:142)
           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:217)
           ... 5 more
   Caused by: java.sql.BatchUpdateException: ORA-01461: ���ܰ�Ҫ���� LONG �е� LONG ֵ
   
           at oracle.jdbc.driver.OraclePreparedStatement.executeLargeBatch(OraclePreparedStatement.java:10032)
           at oracle.jdbc.driver.T4CPreparedStatement.executeLargeBatch(T4CPreparedStatement.java:1364)
           at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9839)
           at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:234)
           at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127)
           at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
           at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.executeBatch(FieldNamedPreparedStatement.java:534)
           at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.executeBatch(SimpleBatchStatementExecutor.java:51)
           at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:89)
           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)
           ... 7 more
   
           at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:203)
           ... 2 more
   2024-08-16 15:13:46,538 INFO  org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand - run shutdown hook because get close signal
   ```
   
   ### SeaTunnel Version
   
   2.3.6
   
   ### SeaTunnel Config
   
   ```conf
   env {
     parallelism = 8
     job.mode = "BATCH"
   }
   
   source {
     Jdbc {
       url = "jdbc:oracle:thin:@127.0.0.1:1521:XE"
       driver = "oracle.jdbc.OracleDriver"
       connection_check_timeout_sec = 100
       user = "test"
       password = "test"
       query = "select * from TEST.LOG"
       fetch_size = 500
     }
   }
   
   sink {
     jdbc {
       url = "jdbc:oracle:thin:@127.0.0.1:1521:XE"
       driver = "oracle.jdbc.OracleDriver"
       connection_check_timeout_sec = 100
       user = "test"
       password = "test"
       database = XE
       table = "TEST.LOG_1"
       generate_sink_sql = true
       support_upsert_by_query_primary_key_exist = true
       primary_keys = ["ID"]
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   .\bin\seatunnel.cmd --config .\script\o1.conf -m local
   ```
   
   
   ### Error Exception
   
   ```log
   can bind a LONG value only for insert into a LONG column
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### 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: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [JDBC] ORA-01461 [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7418:
URL: https://github.com/apache/seatunnel/issues/7418#issuecomment-2351859077

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [JDBC] ORA-01461 [seatunnel]

Posted by "zichen0907 (via GitHub)" <gi...@apache.org>.
zichen0907 commented on issue #7418:
URL: https://github.com/apache/seatunnel/issues/7418#issuecomment-2591704393

   how to solve the problem?


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org