Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-34737][SQL] Cast input float to double in
TIMESTAMP_SECONDS
### What changes were proposed in this pull request? In the PR, I propose to cast the input float to double in the `SecondsToTimestamp` expression in the same way as in the `Cast` expression. ### Why are the changes needed? To have the same results from `CAST(<float> AS TIMESTAMP)` and from `TIMESTAMP_SECONDS`: ```sql spark-sql> SELECT CAST(16777215.0f AS TIMESTAMP); 1970-07-14 07:20:15 spark-sql> SELECT TIMESTAMP_SECONDS(16777215.0f); 1970-07-14 07:20:14.951424 ``` ### Does this PR introduce _any_ user-facing change? Yes. After the changes: ```sql spark-sql> SELECT TIMESTAMP_SECONDS(16777215.0f); 1970-07-14 07:20:15 ``` ### How was this patch tested? By running new test: ``` $ build/sbt "test:testOnly *DateExpressionsSuite" ``` Closes #31831 from MaxGekk/adjust-SecondsToTimestamp. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org>
- Loading branch information