-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[MINOR][SQL][DOCS] Improve unix_timestamp's scaladoc (and typo hunting) #17801
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 #76266 has finished for PR 17801 at commit
|
| * | ||
| * A pattern could be for instance `dd.MM.yyyy` and could return a string like '18.03.1993'. All | ||
| * pattern letters of `java.text.SimpleDateFormat` can be used. | ||
| * pattern letters of [[https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html java.text.SimpleDateFormat]] can be used. |
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 don't generally link to external javadoc, and we've had problems creating a normal javadoc link to the class in many instances. For consistency, I wouldn't bother with this.
|
Test build #76267 has finished for PR 17801 at commit
|
|
Are the errors (that led to |
| * Converts time string with given pattern to Unix timestamp (in seconds). | ||
| * Returns `null` if fails. | ||
| * | ||
| * @see [[http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html Customizing Formats]] |
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.
It looks the documentation generation for Javadoc 8 is being failed due to @see with link -
[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/target/java/org/apache/spark/sql/functions.java:2996: error: self-closing element not allowed
[error] * @see <a href="http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html Customizing Formats"/>
[error] ^
[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/target/java/org/apache/spark/sql/functions.java:2996: error: invalid uri: "http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html Customizing Formats"
[error] * @see <a href="http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html Customizing Formats"/>
[error] ^
Probably, we should wrap it href as I did before - #16013 or find a way to make this link properly (or just remove it).
The other errors seem spurious. Please refer my observation - #17389 (comment)
HyukjinKwon
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.
These are all from me.
| * Gets current Unix timestamp in seconds. | ||
| * Returns the current Unix timestamp (in seconds). | ||
| * | ||
| * NOTE: All calls of `unix_timestamp` within the same query return the same value |
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.
Should we use @note and fix the corresponding contents in Python and R if applicable?
| * Converts time string with given pattern to Unix timestamp (in seconds). | ||
| * Returns `null` if fails. | ||
| * | ||
| * @see <a href="http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html">Customizing Formats</a> |
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.
@see <a href="http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html">
Customizing Formats</a>
Given my past try, the above one works - #15999 (comment) (IIRC, I checked the output).
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 can avoid having scalastyle:off
|
Test build #76528 has finished for PR 17801 at commit
|
|
Test build #76546 has finished for PR 17801 at commit
|
gatorsmile
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.
LGTM
|
Thanks! Merging to master. |
## What changes were proposed in this pull request? * Docs are consistent (across different `unix_timestamp` variants and their internal expressions) * typo hunting ## How was this patch tested? local build Author: Jacek Laskowski <[email protected]> Closes apache#17801 from jaceklaskowski/unix_timestamp.
What changes were proposed in this pull request?
unix_timestampvariants and their internal expressions)How was this patch tested?
local build