MaxGekk commented on code in PR #36857: URL: https://github.com/apache/spark/pull/36857#discussion_r898699293
########## sql/core/src/test/resources/sql-tests/inputs/cast.sql: ########## @@ -116,3 +116,11 @@ select cast(interval '10' day as bigint); select cast(interval '-1000' month as tinyint); select cast(interval '1000000' second as smallint); + +-- cast ANSI intervals to decimals +select cast(interval '-1' year as decimal(10, 0)); +select cast(interval '1.000001' second as decimal(10, 6)); +select cast(interval '08:11:10.001' hour to second as decimal(10, 4)); +select cast(interval '1 01:02:03.1' day to second as decimal(8, 1)); + +select cast(interval '10.123' second as decimal(1, 0)); Review Comment: I added a check. The result is truncated. Please, take a look. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
