-
Notifications
You must be signed in to change notification settings - Fork 595
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
fix(sink): construct java.sql.time/date object with a long type #13651
Conversation
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.
LGTM as we discussed
Not familiar about current implementation in Java. But FYI: |
// construct java.sql.Time/Timestamp with milliseconds time value. | ||
// it will use system timezone by default, so we have to set timezone manually | ||
case TIME: | ||
SimpleDateFormat tDfm = new SimpleDateFormat("HH:mm:ss.SSS"); |
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.
The formatter can be stored as a static field to avoid repeatedly creating the objects.
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.
SimpleDateFormatter
aren’t thread-safe. Using a static formatter seems to lead to incorrect data and test failure. https://buildkite.com/risingwavelabs/pull-request/builds/36192#018c1499-1f24-4950-a41a-d703aaaec4e2
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's one of the many reasons to prefer java.time.*
But yes it may need a prior refactor for other remote sinks as well.
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.
SimpleDateFormatter aren’t thread-safe. Using a static formatter seems to lead to incorrect data and test failure. https://buildkite.com/risingwavelabs/pull-request/builds/36192#018c1499-1f24-4950-a41a-d703aaaec4e2
If so we can store them as a ordinary field instead of a static field and create an instance for each sink writer, since within a single sink writer it's single threaded.
It seems that all remote sinks use |
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.
LGTM.
Are the changes in this PR covered by any CI pipeline?
I have updated the es_sink e2e test. |
@xuefengze Can we merge this PR? |
Need review from Cargo.lock? |
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.
LGTM for Cargo.lock
d7d56bd
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
resolve #13637
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.