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

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   
   ### Description
   
   The error prompt of SQL transform does not indicate which specific field has 
a problem.
   
   ---
   
   SQL transform 报错提示不到具体是哪个字段有问题
   
   for example:
   ```
   source {
     Jdbc {
       "url" = "jdbc:oracle:thin:@<oracle-host>:1521/<service_name>"
       "driver" = "oracle.jdbc.OracleDriver"
       "user" = "<username>"
       "password" = "<password>"
       "query" = "select FIELD1, FIELD2, FIELD3 from some_table"
       "result_table_name" = "Table0001"
     }
   }
   
   transform {
     Sql {
       "table_transform" = [
         {
           tablePath = "some_table"
           query = """
             select 
               cast(FIELD1 as string) as field1,
               cast(FIELD2 as decimal(22,4)) as field2,
               cast(FIELD3 as decimal(22,0)) as field3
             from `some_table`
           """
         }
       ]
       "source_table_name" = "Table0001"
       "result_table_name" = "Table0002"
     }
   }
   
   sink {
     Maxcompute {
       "accessId" = "<accessId>"
       "accessKey" = "<accessKey>"
       "endpoint" = "<endpoint>"
       "project" = "<project>"
       "table_name" = "target_table"
       "partition_spec" = "biz_date=20250408"
       "overwrite" = true
       "source_table_name" = "Table0002"
     }
   }
   ```
   
   The task result will be shown like this,
   ```
   java.lang.NumberFormatException
        at java.math.BigDecimal.<init>(BigDecimal.java:497)
        at java.math.BigDecimal.<init>(BigDecimal.java:383)
        at java.math.BigDecimal.<init>(BigDecimal.java:809)
        at 
org.apache.seatunnel.transform.sql.zeta.functions.SystemFunction.castAs(SystemFunction.java:165)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.executeCastExpr(ZetaSQLFunction.java:542)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.computeForValue(ZetaSQLFunction.java:296)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.project(ZetaSQLEngine.java:264)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.transformBySQL(ZetaSQLEngine.java:234)
        at 
org.apache.seatunnel.transform.sql.SQLTransform.transformRow(SQLTransform.java:114)
        at 
org.apache.seatunnel.transform.common.AbstractCatalogSupportTransform.map(AbstractCatalogSupportTransform.java:53)
        at 
org.apache.seatunnel.transform.common.AbstractCatalogSupportTransform.map(AbstractCatalogSupportTransform.java:33)
        at 
org.apache.seatunnel.transform.common.AbstractMultiCatalogSupportTransform.map(AbstractMultiCatalogSupportTransform.java:73)
        at 
org.apache.seatunnel.transform.common.AbstractMultiCatalogSupportTransform.map(AbstractMultiCatalogSupportTransform.java:36)
        at 
org.apache.seatunnel.engine.server.task.flow.TransformFlowLifeCycle.received(TransformFlowLifeCycle.java:109)
        at 
org.apache.seatunnel.engine.server.task.flow.TransformFlowLifeCycle.received(TransformFlowLifeCycle.java:38)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelSourceCollector.sendRecordToNext(SeaTunnelSourceCollector.java:204)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelSourceCollector.collect(SeaTunnelSourceCollector.java:119)
        at 
org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSourceReader.pollNext(JdbcSourceReader.java:70)
        at 
org.apache.seatunnel.engine.server.task.flow.SourceFlowLifeCycle.collect(SourceFlowLifeCycle.java:156)
        at 
org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.collect(SourceSeaTunnelTask.java:116)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:169)
        at 
org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:121)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:735)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1048)
        at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43)
        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:748)
   ```
   It doesn't show which field it is, but we want to know which field caused 
this exception.
   
   
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] 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-unsubscr...@seatunnel.apache.org.apache.org

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

Reply via email to