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

WIP - Lower the datetime limit to what CH also accepts - 1900-01-01 #1386

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abdelhakimbendjabeur
Copy link

@abdelhakimbendjabeur abdelhakimbendjabeur commented Jun 23, 2023

Summary

Removing the layer that performs whether a datetime is within a predefined range works fine.

On Postgres
created_datetime     |    sent_datetime    
---------------------+---------------------
 2022-11-10 13:39:35 | 2300-11-09 20:38:58
 
On CH
"created_datetime": "2022-11-10 13:39:35.000000"
"sent_datetime": "2299-12-31 23:38:58.000000"
 
 
PS. writeDateTime64 does not seem to be used anywhere

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@abdelhakimbendjabeur abdelhakimbendjabeur force-pushed the abdelhakimbendjabeur/extend-min-datetime-limit branch from 7863ce7 to 17f43db Compare June 24, 2023 12:05
@zhicwu zhicwu linked an issue Jun 26, 2023 that may be closed by this pull request
@zhicwu
Copy link
Contributor

zhicwu commented Jun 26, 2023

Thanks @abdelhakimbendjabeur for the pull request. I linked an issue whifh contains more information that you may want to check. Ideally, we probably should drop range check in Java client and only do that JDBC driver.

@den-crane
Copy link
Collaborator

den-crane commented Jun 26, 2023

https://clickhouse.com/docs/en/sql-reference/data-types/datetime64

Note: The precision of the maximum value is 8. If the maximum precision of 9 digits (nanoseconds) is used, the maximum supported value is 2262-04-11 23:47:16 in UTC.

@abdelhakimbendjabeur
Copy link
Author

https://clickhouse.com/docs/en/sql-reference/data-types/datetime64

Note: The precision of the maximum value is 8. If the maximum precision of 9 digits (nanoseconds) is used, the maximum supported value is 2262-04-11 23:47:16 in UTC.

Hi @den-crane , in the docs it says the upper limit is 2299-12-31 23:59:59.99999999. I have some rows that could go up to this datetime

@den-crane
Copy link
Collaborator

@abdelhakimbendjabeur Note: The precision of the maximum value is 8.
I don't see a check of the precision in JAVA code.

TimonSP added a commit to TimonSP/clickhouse-java that referenced this pull request Jan 9, 2024
mzitnik pushed a commit that referenced this pull request Jan 11, 2024
…limits check layer (#1518)

* Update Date32 and DateTime64 range for ClickHouse, remove datetime64 limits check layer #1103 #1386 #1441

* fix of byte arrays for updated dates in BinaryStreamUtilsTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateTime/Date limits not compatible with CH server limits
3 participants