-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-18734][SS] Represent timestamp in StreamingQueryProgress as formatted string instead of millis #16166
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
|
Test build #69710 has finished for PR 16166 at commit
|
zsxwing
left a comment
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.
One minor issue about the time zone. Otherwise, LGTM.
| // The timestamp we report an event that has no input data | ||
| private var lastNoDataProgressEventTime = Long.MinValue | ||
|
|
||
| private val timestampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") // ISO8601 |
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.
You need to set the timezone before using this format. Otherwise, the time is based on your timezone. E.g.,
scala> new java.util.Date()
res7: java.util.Date = Tue Dec 06 10:48:00 PST 2016
scala> val timestampFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
timestampFormat: java.text.SimpleDateFormat = java.text.SimpleDateFormat@5af7aed5
scala> timestampFormat.format(new java.util.Date())
res8: String = 2016-12-06T10:48:09.342Z
scala> val timestampFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
timestampFormat: java.text.SimpleDateFormat = java.text.SimpleDateFormat@5af7aed5
scala> timestampFormat.setTimeZone(java.util.TimeZone.getTimeZone("UTC"))
scala> timestampFormat.format(new java.util.Date())
res10: String = 2016-12-06T18:48:20.048Z
|
Test build #69749 has finished for PR 16166 at commit
|
|
LGTM. Merging to master and 2.1. |
…rmatted string instead of millis ## What changes were proposed in this pull request? Easier to read while debugging as a formatted string (in ISO8601 format) than in millis ## How was this patch tested? Updated unit tests Author: Tathagata Das <[email protected]> Closes #16166 from tdas/SPARK-18734. (cherry picked from commit 539bb3c) Signed-off-by: Shixiong Zhu <[email protected]>
…rmatted string instead of millis ## What changes were proposed in this pull request? Easier to read while debugging as a formatted string (in ISO8601 format) than in millis ## How was this patch tested? Updated unit tests Author: Tathagata Das <[email protected]> Closes apache#16166 from tdas/SPARK-18734.
…rmatted string instead of millis ## What changes were proposed in this pull request? Easier to read while debugging as a formatted string (in ISO8601 format) than in millis ## How was this patch tested? Updated unit tests Author: Tathagata Das <[email protected]> Closes apache#16166 from tdas/SPARK-18734.
What changes were proposed in this pull request?
Easier to read while debugging as a formatted string (in ISO8601 format) than in millis
How was this patch tested?
Updated unit tests