GreptimeTeam/greptimedb

Timestamp display precision should respect column schema

Geschlossen

#8.227 geöffnet am 03.06.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (522 Forks)github user discovery
C-enhancementgood first issue

Repository-Metriken

Stars
 (6.544 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

What type of enhancement is this?

User experience

What does the enhancement do?

Currently, when querying GreptimeDB through the MySQL CLI, timestamp rendering does not always respect the timestamp precision defined by the column schema. (Maybe pg cli also has this problem)

For example

create table

CREATE TABLE ts_precision_test (
    ts_s  TIMESTAMP(0),
    ts_ms TIMESTAMP(3),
    ts_us TIMESTAMP(6),
    ts_ns TIMESTAMP(9),
    v     INT32,
    TIME INDEX (ts_ms),
    PRIMARY KEY (v)
);

insert data

INSERT INTO ts_precision_test VALUES (
    '2026-06-02 03:50:00',
    '2026-06-02 03:50:00.195',
    '2026-06-02 03:50:00.195123',
    '2026-06-02 03:50:00.195123456',
    1
);

query data

SELECT * FROM ts_precision_test;

actual output

+---------------------+----------------------------+----------------------------+----------------------------+------+
| ts_s                | ts_ms                      | ts_us                      | ts_ns                      | v    |
+---------------------+----------------------------+----------------------------+----------------------------+------+
| 2026-06-02 03:50:00 | 2026-06-02 03:50:00.195000 | 2026-06-02 03:50:00.195123 | 2026-06-02 03:50:00.195123 |    1 |
+---------------------+----------------------------+----------------------------+----------------------------+------+

expected output

+---------------------+----------------------------+----------------------------+-------------------------------+------+
| ts_s                | ts_ms                      | ts_us                      | ts_ns                         | v    |
+---------------------+----------------------------+----------------------------+-------------------------------+------+
| 2026-06-02 03:50:00 | 2026-06-02 03:50:00.195    | 2026-06-02 03:50:00.195123 | 2026-06-02 03:50:00.195123456 |    1 |
+---------------------+----------------------------+----------------------------+-------------------------------+------+

Implementation challenges

No response

Contributor Guide