-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use Instant to track session start time #3761
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
Conversation
presto-main/src/main/java/io/prestosql/testing/TestingConnectorSession.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/testing/TestingConnectorSession.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/testing/TestingConnectorSession.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In session builder you can leave an overload taking millis, this would improve readability of the code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to discourage usages where it's constructing the Instant from millis. Ideally, all these calls should use Java's datetime to instant conversions instead of using Joda's DateTime .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add @Deprecated too?
(should we have a static check?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by a static check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using deprecated in the Javadoc without the annotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Is it even feasible to do that with checkstyle?
This is needed for higher precision version of the special datetime functions (localtimestamp, current_timestamp, etc), since Instant can provide nanosecond precision vs the current value in milliseconds.
936634c to
18ff2e5
Compare
This is needed for higher precision version of the special
datetime functions (localtimestamp, current_timestamp, etc),
since Instant can provide nanosecond precision vs the current
value in milliseconds.