joint-song opened a new issue, #8978:
URL: https://github.com/apache/seatunnel/issues/8978

   ### 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
   
   We have tons of batch tasks to transfer data from Hive to Clickhouse. 
Casting invalid numeric format of string to integer will got 'null' before 
2.3.0. After upgraded seatunnel to 2.3.8, these transforms then are failed due 
to invalid format of number. These invalid formats include: blank string, 
floating-point number format string, and other wild format string values.
   
   And after some investigation, the problem is the way how Zeta and Spark cast 
invalid value. Spark will produce 'null' for invalid format value. Zeta then 
simply throw exception for invalid value.
   
   ### SeaTunnel Version
   
   Seatunnel 2.3.8
   
   ### SeaTunnel Config
   
   ```conf
   env {
     parallelism = 1
     job.mode = "BATCH"
   }
   
   source {
     FakeSource {
       result_table_name = "fake"
       row.num = 16
       schema = {
         fields {
           name = "string"
         }
       }
     }
   }
   
   transform {
     Sql {
       source_table_name = "fake"
       result_table_name = "fake1"
       query = "SELECT CAST(fake.`name` AS integer) AS `v0` FROM fake"
     }
   }
   
   sink {
     Console {
       source_table_name = "fake1"
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   
/a8root/work/service/calculate.onedata.task-runner/data/apache-seatunnel-2.3.8/bin/start-seatunnel-spark-2-connector-v2.sh
 --config config_file --name local_test
   ```
   
   ### Error Exception
   
   ```log
   Caused by: java.lang.NumberFormatException: For input string: "mgbZn"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at 
org.apache.seatunnel.transform.sql.zeta.functions.SystemFunction.castAs(SystemFunction.java:99)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.executeCastExpr(ZetaSQLFunction.java:557)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.computeForValue(ZetaSQLFunction.java:315)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.project(ZetaSQLEngine.java:271)
        at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.transformBySQL(ZetaSQLEngine.java:241)
        at 
org.apache.seatunnel.transform.sql.SQLTransform.transformRow(SQLTransform.java:108)
        at 
org.apache.seatunnel.transform.common.AbstractCatalogSupportTransform.map(AbstractCatalogSupportTransform.java:50)
        at 
org.apache.seatunnel.transform.common.AbstractCatalogSupportTransform.map(AbstractCatalogSupportTransform.java:30)
        at 
org.apache.seatunnel.core.starter.spark.execution.TransformExecuteProcessor$TransformIterator.next(TransformExecuteProcessor.java:210)
        ... 20 more
   ```
   
   ### Zeta or Flink or Spark Version
   
   spark 2.2
   
   ### Java or Scala Version
   
   java 8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to