MaxGekk opened a new pull request #28843:
URL: https://github.com/apache/spark/pull/28843


   ### What changes were proposed in this pull request?
   Replace `CAST(... AS TIMESTAMP` by `TIMESTAMP_SECONDS` in the following 
benchmarks:
   - ExtractBenchmark
   - DateTimeBenchmark
   - FilterPushdownBenchmark
   - InExpressionBenchmark
   
   ### Why are the changes needed?
   The benchmarks fail w/o the changes:
   ```
   [info] Running benchmark: datetime +/- interval
   [info]   Running case: date + interval(m)
   [error] Exception in thread "main" org.apache.spark.sql.AnalysisException: 
cannot resolve 'CAST(`id` AS TIMESTAMP)' due to data type mismatch: cannot cast 
bigint to timestamp,you can enable the casting by setting 
spark.sql.legacy.allowCastNumericToTimestamp to true,but we strongly recommend 
using function TIMESTAMP_SECONDS/TIMESTAMP_MILLIS/TIMESTAMP_MICROS instead.; 
line 1 pos 5;
   [error] 'Project [(cast(cast(id#0L as timestamp) as date) + 1 months) AS 
(CAST(CAST(id AS TIMESTAMP) AS DATE) + INTERVAL '1 months')#2]
   [error] +- Range (0, 10000000, step=1, splits=Some(1))
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   By running the affected benchmarks.
   


----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to