[ https://issues.apache.org/jira/browse/IGNITE-24934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Pereslegin updated IGNITE-24934: -------------------------------------- Summary: Sql. Inconsistent behavior for truncated TIME/TIMESTAMP value (was: Sql. Inconsistent behavior of the truncated TIME/TIMESTAMP value) > Sql. Inconsistent behavior for truncated TIME/TIMESTAMP value > ------------------------------------------------------------- > > Key: IGNITE-24934 > URL: https://issues.apache.org/jira/browse/IGNITE-24934 > Project: Ignite > Issue Type: Bug > Components: sql > Affects Versions: 3.0 > Reporter: Pavel Pereslegin > Priority: Major > Labels: ignite-3 > > In the following test case the value is truncated with rounding > {code} > # Value must be rounded up. > query T > SELECT '2008-01-01 00:00:01.9995'::TIMESTAMP(3)::VARCHAR > ---- > 2008-01-01 00:00:02 > {code} > But the same example with precision = 2 truncates value without rounding > {code:java} > assertQuery("SELECT '2024-01-01 20:08:10.999'::TIMESTAMP(2)::VARCHAR") > .returns("2024-01-01 20:08:11") > .check(); > {code} > {noformat} > Expected: 2024-01-01 20:08:11 <class java.lang.String> > Actual: 2024-01-01 20:08:10.99 <class java.lang.String> > {noformat} > The same is reproduced for TIME type also. > This issue may be related to IGNITE-24889. > Looks like we don't have rounding for numerics now, for example > {code:sql} > SELECT 10.7::INT --- 10 > {code} > Therefore, we should not round values when truncating temporary types. -- This message was sent by Atlassian Jira (v8.20.10#820010)