questdb / questdb

QuestDB is an open source time-series database for fast ingest and SQL queries
https://questdb.io
Apache License 2.0
14.33k stars 1.15k forks source link

Timestamp always shows as 1970-X-X when importing via Line Protocol in QuestDB UI #1202

Closed voycey closed 3 years ago

voycey commented 3 years ago

Describe the bug When importing a microsecond timestamp, in the QuestDB UI this always shows as 1970-x-x

To Reproduce Import the following daily,meter_id=NEM1206106 export_interval_total=3.0,import_interval_total=0.0,week_of_year=10,day_of_month=2,month=3,year=2004,hour=17,minute=30,reading_date_time="2004-03-02T17:30:00.000000",date_str="20040302" 1078248600000000

Expected behavior Epoch converters show 1078248600000000 correctly as:

Assuming that this timestamp is in microseconds (1/1,000,000 second):
GMT: Tuesday, 2 March 2004 17:30:00
Your time zone: Wednesday, 3 March 2004 03:30:00 GMT+10:00
Relative: 17 years ago

Screenshots image

Environment (please complete the following information):

voycey commented 3 years ago

I have also checked this in a different client via a postgres connection and it has inserted as that. Where am I going wrong with this?

marregui commented 3 years ago

Hi @voycey

By default questdb is expecting precision in nanos, so the timestamp in the line is 3x zeroes short. The precision can be changed through configuration.

The TCP receiver configuration can be completely customized using configuration keys. You can use this to configure the tread pool, buffer and queue sizes, receiver IP address and port, load balancing etc.

https://questdb.io/docs/reference/configuration/#influxdb-line-protocol-tcp

The property is line.tcp.timestamp, set it to u.

voycey commented 3 years ago

Thanks, documentation still shows "Microseconds" as the requirements, you might want to update that (I used the getting started pages)