Skip to content
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

What will the datetime data type #4994

Closed
BohuTANG opened this issue Apr 22, 2022 · 3 comments · Fixed by #4997
Closed

What will the datetime data type #4994

BohuTANG opened this issue Apr 22, 2022 · 3 comments · Fixed by #4997
Assignees
Labels
A-query Area: databend query

Comments

@BohuTANG
Copy link
Member

@sundy-li @Veeupup

What's the databend final datetime data type is?
In some database systems(snow, bigquery, duckdb, cockroachdb), they are introduce only one type: timestamp(datetime may be a aliases name in some of them), and the range:

0001-01-01 00:00:00 to 9999-12-31 23:59:59.999999 UTC

Supports precision levels from 0 (seconds) to 6 (microseconds) .

I suggest the default is TIMESTAMP(6), what do you think?

Originally posted by @BohuTANG in #4982 (comment)

@sundy-li
Copy link
Member

sundy-li commented Apr 22, 2022

I think TIMESTAMP is aliased to DATETIME.

Cockroachdb has custom precision, Timestamp(n):
eg:

CREATE TABLE timestamps (a INT PRIMARY KEY, b TIMESTAMP(3));

@BohuTANG
Copy link
Member Author

OK.
Then the problem is what the default date time value is?

@sundy-li
Copy link
Member

sundy-li commented Apr 22, 2022

I checked bigquery and Cockroachdb , we can make the default precision to be 6.

DateTime equals to DateTime(6), Timestamp(6), Timestamp , @Veeupup

The range of precision is [0, 9] is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants