You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2023/03/30 06:19:00 UTC
[jira] [Created] (IGNITE-19162) Sql. Trim all less than millisecond information from timestamp.
Evgeny Stanilovsky created IGNITE-19162:
-------------------------------------------
Summary: Sql. Trim all less than millisecond information from timestamp.
Key: IGNITE-19162
URL: https://issues.apache.org/jira/browse/IGNITE-19162
Project: Ignite
Issue Type: Bug
Components: sql
Affects Versions: 3.0.0-beta1
Reporter: Evgeny Stanilovsky
Trim useful timestamp part:
{noformat}
CREATE TABLE timestamps(id INTEGER PRIMARY KEY, i TIMESTAMP(9));
INSERT INTO timestamps VALUES (101, TIMESTAMP '2023-03-29 08:22:33.005007');
SELECT i from timestamps; <--- expect inserted, obtain trimmed : 2023-03-29 08:22:33.005
{noformat}
The root cause :
RelJson#toJson() -> getValue3 -> getValue2 ->
RexLiteral#getValueAs ->
case TIMESTAMP:
if (clazz == Long.class) {
// Milliseconds since 1970-01-01 00:00:00
return clazz.cast(((TimestampString) value).getMillisSinceEpoch()); <-- here info is loosed.
}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)