-
Notifications
You must be signed in to change notification settings - Fork 29k
[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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
20edec8
[MINOR][SQL][DOCS] Improve unix_timestamp's scaladoc (and typo hunting)
jaceklaskowski c3cc96b
Review round 1
jaceklaskowski 742fbb4
Review round 2
jaceklaskowski 5326ad1
Merge remote-tracking branch 'origin/master' into unix_timestamp
jaceklaskowski 1079b7d
Review round 3
jaceklaskowski 581e8e4
Merge remote-tracking branch 'origin/master' into unix_timestamp
jaceklaskowski c96f137
Review round 3 (missed one comment)
jaceklaskowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2491,10 +2491,10 @@ object functions { | |
| * Converts a date/timestamp/string to a value of string in the format specified by the date | ||
| * format given by the second argument. | ||
| * | ||
| * 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. | ||
| * A pattern `dd.MM.yyyy` would return a string like `18.03.1993`. | ||
| * All pattern letters of `java.text.SimpleDateFormat` can be used. | ||
| * | ||
| * @note Use when ever possible specialized functions like [[year]]. These benefit from a | ||
| * @note Use specialized functions like [[year]] whenever possible as they benefit from a | ||
| * specialized implementation. | ||
| * | ||
| * @group datetime_funcs | ||
|
|
@@ -2647,7 +2647,11 @@ object functions { | |
| } | ||
|
|
||
| /** | ||
| * 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 | ||
| * (i.e. the current timestamp is calculated at the start of query evaluation). | ||
| * | ||
| * @group datetime_funcs | ||
| * @since 1.5.0 | ||
| */ | ||
|
|
@@ -2657,22 +2661,27 @@ object functions { | |
|
|
||
| /** | ||
| * Converts time string in format yyyy-MM-dd HH:mm:ss to Unix timestamp (in seconds), | ||
| * using the default timezone and the default locale, return null if fail. | ||
| * using the default timezone and the default locale. | ||
| * Returns `null` if fails. | ||
| * | ||
| * @group datetime_funcs | ||
| * @since 1.5.0 | ||
| */ | ||
| def unix_timestamp(s: Column): Column = withExpr { | ||
| UnixTimestamp(s.expr, Literal("yyyy-MM-dd HH:mm:ss")) | ||
| } | ||
|
|
||
| // scalastyle:off line.size.limit | ||
| /** | ||
| * Convert time string with given pattern | ||
| * (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html]) | ||
| * to Unix time stamp (in seconds), return null if fail. | ||
| * 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> | ||
|
||
| * @group datetime_funcs | ||
| * @since 1.5.0 | ||
| */ | ||
| def unix_timestamp(s: Column, p: String): Column = withExpr {UnixTimestamp(s.expr, Literal(p)) } | ||
| // scalastyle:on | ||
| def unix_timestamp(s: Column, p: String): Column = withExpr { UnixTimestamp(s.expr, Literal(p)) } | ||
|
|
||
| /** | ||
| * Convert time string to a Unix timestamp (in seconds). | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
@noteand fix the corresponding contents in Python and R if applicable?