-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17963][SQL][Documentation] Add examples (extend) in each expression and improve documentation with arguments #15513
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 1 commit
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
5f70b1d
Add examples (extend) in each function and improve documentation with…
HyukjinKwon 77abafa
aggregate OK
HyukjinKwon 8cd6d80
xml OK
HyukjinKwon 2614572
arithmetic OK
HyukjinKwon 29d0262
bitwiseExpressions OK and double-check others
HyukjinKwon 710c68e
CallMethodViaReflection OK
HyukjinKwon 1d44ec3
Cast OK
HyukjinKwon 78b1fc7
collectionOperations OK
HyukjinKwon e2062af
complexTypeCreator OK and double check others
HyukjinKwon e9672db
conditionalExpressions OK
HyukjinKwon 9baa847
datetimeExpressions OK
HyukjinKwon fff85f6
generators OK
HyukjinKwon 2462775
InputFileName OK
HyukjinKwon 10892fb
jsonExpressions OK
HyukjinKwon 45e7f99
mathExpressions OK, double check others and fix scala style
HyukjinKwon 1d69e40
misc OK, double-check others and ignore a test in SQLQuerySuite for now
HyukjinKwon 9b24e78
MonotonicallyIncreasingID OK
HyukjinKwon ed1c839
nullExpressions OK
HyukjinKwon 1535186
predicates OK
HyukjinKwon 8efee7e
randomExpressions OK
HyukjinKwon a111d2a
regexpExpressions OK
HyukjinKwon a8ddcc2
SparkPartitionID OK
HyukjinKwon 99b5658
tringExpressions OK
HyukjinKwon a29472e
windowExpressions OK
HyukjinKwon 73ccda0
conditionalExpressions OK, double-check others and fix tests
HyukjinKwon d927bff
double-check
HyukjinKwon 91d2ab5
Fix tests in SQLQuerySuite and DDLSuite first
HyukjinKwon 7841860
Take out a space after `Extended Usage:`.
HyukjinKwon 01eecfe
Consistent spacing in Examples
HyukjinKwon 1979d92
Remove repeated _FUNC_, consolidate usages and simplify the arguments
HyukjinKwon d56ac66
Fix tests DDLSuite, SQLQuerySuite and hive/SQLQuerySuite with consist…
HyukjinKwon 8a773d4
Fix scala style.
HyukjinKwon f71e39e
double-check
HyukjinKwon caa71c8
double-check again
HyukjinKwon 5163a87
Address Sean's comments
HyukjinKwon f8d11aa
another double-check
HyukjinKwon da40f85
Fix the tests in DDLSuite
HyukjinKwon feafdc2
another double-check
HyukjinKwon 2656c62
another double-check
HyukjinKwon 15c02ca
Address comments and another double-check
HyukjinKwon 035baef
revert mistakes
HyukjinKwon c55ecb6
another double-check and remove extra change for newlines
HyukjinKwon ad7b71d
Address comments
HyukjinKwon 3965d00
Address comments
HyukjinKwon 498d69c
Missed ones
HyukjinKwon 400cee5
add back-quotes, fix typos and specify the types more specifically
HyukjinKwon 2b437fe
address type and more details
HyukjinKwon 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
double-check again
- Loading branch information
commit caa71c89d67d7168a527c953c74be7bc5c4da27f
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,11 +114,11 @@ object Cast { | |
|
|
||
| /** Cast the child expression to the target data type. */ | ||
| @ExpressionDescription( | ||
| usage = "_FUNC_(expr AS type) - Casts value expr to the target data type.", | ||
| usage = "_FUNC_(expr AS type) - Casts the value expr to the target data type.", | ||
| extended = """ | ||
| Arguments: | ||
| expr - an expression of any type. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spark-sql> SELECT cast(array(1) as string), cast(struct(1) as string), cast(map(1,1) as string);
[1] [1] keys: [1], values: [1] |
||
| type - data type. | ||
| type - data type to cast expr into. | ||
|
|
||
| Examples: | ||
| > SELECT _FUNC_('10' as int); | ||
|
|
||
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
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 |
|---|---|---|
|
|
@@ -26,16 +26,14 @@ import org.apache.spark.sql.types._ | |
| @ExpressionDescription( | ||
| usage = "_FUNC_(expr1, expr2, expr3) - If expr1 is TRUE then IF() returns expr2; otherwise it returns expr3.", | ||
| extended = """ | ||
| _FUNC_(expr1, expr2, expr3) | ||
|
|
||
| Arguments: | ||
| expr1 - a boolean expression. | ||
| expr2 - an expression of any type that represents the return value when expr1 is TRUE. | ||
| expr3 - an expression of any type that represents the return value when expr1 is FALSE. | ||
|
|
||
| Examples: | ||
| > SELECT _FUNC_(1 < 2, 'a', 'b'); | ||
| a | ||
| Arguments: | ||
| expr1 - a boolean expression. | ||
| expr2 - an expression of any type that represents the return value when expr1 is TRUE. | ||
|
||
| expr3 - an expression of any type that represents the return value when expr1 is FALSE. | ||
|
|
||
| Examples: | ||
| > SELECT _FUNC_(1 < 2, 'a', 'b'); | ||
| a | ||
| """) | ||
| // scalastyle:on line.size.limit | ||
| case class If(predicate: Expression, trueValue: Expression, falseValue: Expression) | ||
|
|
||
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
Oops, something went wrong.
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.
is it always literal?
Uh oh!
There was an error while loading. Please reload this page.
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.
Oh, it seems
argis not. Let me try to find again such mistakes here.