[
https://issues.apache.org/jira/browse/IGNITE-24934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Pereslegin updated IGNITE-24934:
--------------------------------------
Description:
The following test works fine
{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
{code:java}
assertQuery("SELECT '2024-01-01 20:08:10.998'::TIMESTAMP(2)")
.returns(LocalDateTime.of(2024, Month.JANUARY, 1, 20, 8, 11))
.check();
{code}
fails
{noformat}
org.opentest4j.AssertionFailedError: Collections are not equal (position 0):
Expected: 2024-01-01T20:08:11 <class java.time.LocalDateTime>
Actual: 2024-01-01T20:08:10.990 <class java.time.LocalDateTime>
{noformat}
The same is reproduced for TIME type also.
This issue may be related to IGNITE-24889.
was:
The following test works fine
{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
{code:java}
assertQuery("SELECT '2024-01-01 20:08:10.998'::TIMESTAMP(2)")
.returns(LocalDateTime.of(2024, Month.JANUARY, 1,
expected.getHour(), expected.getMinute(), expected.getSecond()))
.check();
{code}
fails
{noformat}
org.opentest4j.AssertionFailedError: Collections are not equal (position 0):
Expected: 2024-01-01T20:08:11 <class java.time.LocalDateTime>
Actual: 2024-01-01T20:08:10.990 <class java.time.LocalDateTime>
{noformat}
The same is reproduced for TIME type also.
> Sql. The TIME/TIMESTAMP value is truncated without rounding.
> ------------------------------------------------------------
>
> Key: IGNITE-24934
> URL: https://issues.apache.org/jira/browse/IGNITE-24934
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Pavel Pereslegin
> Priority: Major
> Labels: ignite-3
>
> The following test works fine
> {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
> {code:java}
> assertQuery("SELECT '2024-01-01 20:08:10.998'::TIMESTAMP(2)")
> .returns(LocalDateTime.of(2024, Month.JANUARY, 1, 20, 8, 11))
> .check();
> {code}
> fails
> {noformat}
> org.opentest4j.AssertionFailedError: Collections are not equal (position 0):
> Expected: 2024-01-01T20:08:11 <class java.time.LocalDateTime>
> Actual: 2024-01-01T20:08:10.990 <class java.time.LocalDateTime>
> {noformat}
> The same is reproduced for TIME type also.
> This issue may be related to IGNITE-24889.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)