Skip to content

greptime_timestamp displays null values #6198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
evenyag opened this issue May 28, 2025 · 1 comment
Open

greptime_timestamp displays null values #6198

evenyag opened this issue May 28, 2025 · 1 comment
Labels
C-bug Category Bugs

Comments

@evenyag
Copy link
Contributor

evenyag commented May 28, 2025

What type of bug is this?

Unexpected error, Incorrect result

What subsystems are affected?

Standalone mode

Minimal reproduce step

Creates a table with a millisecond timestamp column.

create table ms_ts(greptime_timestamp Timestamp(3) time index);

Inserts a timestamp in nanosecond

insert into ms_ts(greptime_timestamp) values(1747814093865000000);

What did you expect to see?

The timestamp value.

What did you see instead?

select * from ms_ts;
+--------------------+
| greptime_timestamp |
+--------------------+
| NULL               |
+--------------------+
1 row in set (0.04 sec)

What operating system did you use?

macOS

What version of GreptimeDB did you use?

0.14.3

Relevant log output and stack trace

insert into ms_ts(greptime_timestamp) values(1747814093865000001);

select * from ms_ts;
+--------------------+
| greptime_timestamp |
+--------------------+
| NULL               |
| NULL               |
+--------------------+
2 rows in set (0.05 sec)
@evenyag evenyag added the C-bug Category Bugs label May 28, 2025
@evenyag evenyag changed the title greptime_timestamp contains null values greptime_timestamp displays null values May 28, 2025
@evenyag
Copy link
Contributor Author

evenyag commented May 28, 2025

After casting the timestamp into integers, we can see the values:


select greptime_timestamp::int64 from ms_ts;
+----------------------------------------------------+
| arrow_cast(ms_ts.greptime_timestamp,Utf8("Int64")) |
+----------------------------------------------------+
|                                1747814093865000000 |
|                                1747814093865000001 |
+----------------------------------------------------+
2 rows in set (0.22 sec)

So we stored the timestamp value correctly. The issue arises from formatting the timestamp as date and time.

This may not be a serious issue as users insert the timestamp with the wrong precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

No branches or pull requests

1 participant