Length-Width-Height opened a new issue, #7683:
URL: https://github.com/apache/seatunnel/issues/7683

   ### 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
   
   Why does the second parameter of TIMESTAMPAD() only support positive numbers 
and not negative numbers?
   
![image](https://github.com/user-attachments/assets/f7ec1608-b84e-4461-a54b-8e43164b5311)
   
![image](https://github.com/user-attachments/assets/c12fcfe3-5edc-4773-bb15-d8966524f8ef)
   
   
   ### SeaTunnel Version
   
   2.3.4
   
   ### SeaTunnel Config
   
   ```conf
   transform {
     sql{
       source_table_name = "myTable"
       result_table_name = "myTable1"
       query="SELECT _id,TIMESTAMPADD(create_at,8,'HOUR') as create_at FROM 
myTable"
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   apache-seatunnel-2.3.4-SNAPSHOT/bin/start-seatunnel-spark-2-connector-v2.sh  
--master yarn --deploy-mode client --config mycfg.conf
   ```
   
   
   ### Error Exception
   
   ```log
   org.apache.seatunnel.core.starter.exception.TaskExecuteException: Row 
convert failed, caused: ErrorCode:[COMMON-05], ErrorDescription:[Unsupported 
operation] - Unsupported SQL Expression: -8 
           at 
org.apache.seatunnel.core.starter.spark.execution.TransformExecuteProcessor$TransformIterator.next(TransformExecuteProcessor.java:191)
           at 
org.apache.seatunnel.core.starter.spark.execution.TransformExecuteProcessor$TransformIterator.next(TransformExecuteProcessor.java:152)
           at 
scala.collection.convert.Wrappers$JIteratorWrapper.next(Wrappers.scala:43)
           at scala.collection.Iterator$$anon$11.next(Iterator.scala:410)
           at 
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown
 Source)
           at 
org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
           at 
org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$11$$anon$1.hasNext(WholeStageCodegenExec.scala:624)
           at 
org.apache.spark.sql.execution.datasources.v2.DataWritingSparkTask$$anonfun$run$3.apply(WriteToDataSourceV2Exec.scala:117)
           at 
org.apache.spark.sql.execution.datasources.v2.DataWritingSparkTask$$anonfun$run$3.apply(WriteToDataSourceV2Exec.scala:116)
           at 
org.apache.spark.util.Utils$.tryWithSafeFinallyAndFailureCallbacks(Utils.scala:1442)
           at 
org.apache.spark.sql.execution.datasources.v2.DataWritingSparkTask$.run(WriteToDataSourceV2Exec.scala:146)
           at 
org.apache.spark.sql.execution.datasources.v2.WriteToDataSourceV2Exec$$anonfun$doExecute$2.apply(WriteToDataSourceV2Exec.scala:67)
           at 
org.apache.spark.sql.execution.datasources.v2.WriteToDataSourceV2Exec$$anonfun$doExecute$2.apply(WriteToDataSourceV2Exec.scala:66)
           at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
           at org.apache.spark.scheduler.Task.run(Task.scala:121)
           at 
org.apache.spark.executor.Executor$TaskRunner$$anonfun$11.apply(Executor.scala:407)
           at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1408)
           at 
org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:413)
           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)
   Caused by: org.apache.seatunnel.transform.exception.TransformException: 
ErrorCode:[COMMON-05], ErrorDescription:[Unsupported operation] - Unsupported 
SQL Expression: -8 
           at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.computeForValue(ZetaSQLFunction.java:247)
           at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLFunction.computeForValue(ZetaSQLFunction.java:211)
           at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.project(ZetaSQLEngine.java:258)
           at 
org.apache.seatunnel.transform.sql.zeta.ZetaSQLEngine.transformBySQL(ZetaSQLEngine.java:228)
           at 
org.apache.seatunnel.transform.sql.SQLTransform.transformRow(SQLTransform.java:115)
           at 
org.apache.seatunnel.transform.common.AbstractSeaTunnelTransform.map(AbstractSeaTunnelTransform.java:40)
           at 
org.apache.seatunnel.transform.common.AbstractSeaTunnelTransform.map(AbstractSeaTunnelTransform.java:26)
           at 
org.apache.seatunnel.core.starter.spark.execution.TransformExecuteProcessor$TransformIterator.next(TransformExecuteProcessor.java:184)
           ... 20 more
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### 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