MaxGekk commented on code in PR #36857: URL: https://github.com/apache/spark/pull/36857#discussion_r898692249
########## 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: Don't see much different between your example and mine. In both cases, there are not enough digits to represent the value. I mean there is a problem with precision first of all, not w/ scale. But let me check. -- 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]
