Skip to content
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 Oct 17, 2016
77abafa
aggregate OK
HyukjinKwon Oct 18, 2016
8cd6d80
xml OK
HyukjinKwon Oct 18, 2016
2614572
arithmetic OK
HyukjinKwon Oct 18, 2016
29d0262
bitwiseExpressions OK and double-check others
HyukjinKwon Oct 18, 2016
710c68e
CallMethodViaReflection OK
HyukjinKwon Oct 18, 2016
1d44ec3
Cast OK
HyukjinKwon Oct 18, 2016
78b1fc7
collectionOperations OK
HyukjinKwon Oct 18, 2016
e2062af
complexTypeCreator OK and double check others
HyukjinKwon Oct 19, 2016
e9672db
conditionalExpressions OK
HyukjinKwon Oct 19, 2016
9baa847
datetimeExpressions OK
HyukjinKwon Oct 19, 2016
fff85f6
generators OK
HyukjinKwon Oct 19, 2016
2462775
InputFileName OK
HyukjinKwon Oct 19, 2016
10892fb
jsonExpressions OK
HyukjinKwon Oct 19, 2016
45e7f99
mathExpressions OK, double check others and fix scala style
HyukjinKwon Oct 19, 2016
1d69e40
misc OK, double-check others and ignore a test in SQLQuerySuite for now
HyukjinKwon Oct 20, 2016
9b24e78
MonotonicallyIncreasingID OK
HyukjinKwon Oct 20, 2016
ed1c839
nullExpressions OK
HyukjinKwon Oct 20, 2016
1535186
predicates OK
HyukjinKwon Oct 20, 2016
8efee7e
randomExpressions OK
HyukjinKwon Oct 20, 2016
a111d2a
regexpExpressions OK
HyukjinKwon Oct 20, 2016
a8ddcc2
SparkPartitionID OK
HyukjinKwon Oct 20, 2016
99b5658
tringExpressions OK
HyukjinKwon Oct 20, 2016
a29472e
windowExpressions OK
HyukjinKwon Oct 20, 2016
73ccda0
conditionalExpressions OK, double-check others and fix tests
HyukjinKwon Oct 20, 2016
d927bff
double-check
HyukjinKwon Oct 20, 2016
91d2ab5
Fix tests in SQLQuerySuite and DDLSuite first
HyukjinKwon Oct 21, 2016
7841860
Take out a space after `Extended Usage:`.
HyukjinKwon Oct 21, 2016
01eecfe
Consistent spacing in Examples
HyukjinKwon Oct 21, 2016
1979d92
Remove repeated _FUNC_, consolidate usages and simplify the arguments
HyukjinKwon Oct 21, 2016
d56ac66
Fix tests DDLSuite, SQLQuerySuite and hive/SQLQuerySuite with consist…
HyukjinKwon Oct 21, 2016
8a773d4
Fix scala style.
HyukjinKwon Oct 21, 2016
f71e39e
double-check
HyukjinKwon Oct 21, 2016
caa71c8
double-check again
HyukjinKwon Oct 22, 2016
5163a87
Address Sean's comments
HyukjinKwon Oct 22, 2016
f8d11aa
another double-check
HyukjinKwon Oct 22, 2016
da40f85
Fix the tests in DDLSuite
HyukjinKwon Oct 22, 2016
feafdc2
another double-check
HyukjinKwon Oct 23, 2016
2656c62
another double-check
HyukjinKwon Oct 23, 2016
15c02ca
Address comments and another double-check
HyukjinKwon Oct 24, 2016
035baef
revert mistakes
HyukjinKwon Oct 24, 2016
c55ecb6
another double-check and remove extra change for newlines
HyukjinKwon Oct 25, 2016
ad7b71d
Address comments
HyukjinKwon Oct 26, 2016
3965d00
Address comments
HyukjinKwon Oct 27, 2016
498d69c
Missed ones
HyukjinKwon Oct 27, 2016
400cee5
add back-quotes, fix typos and specify the types more specifically
HyukjinKwon Oct 27, 2016
2b437fe
address type and more details
HyukjinKwon Oct 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
collectionOperations OK
  • Loading branch information
HyukjinKwon committed Oct 20, 2016
commit 78b1fc75e9c9d931f5ff130109cf2f0d9ce2547b
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ import org.apache.spark.sql.types._
* Given an array or map, returns its size. Returns -1 if null.
*/
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the size of an array or a map.",
extended = " > SELECT _FUNC_(array('b', 'd', 'c', 'a'));\n 4")
usage = "_FUNC_(expr) - Returns the size of an array or a map. Returns -1 if null.",
extended = """
_FUNC_(expr)

Arguments:
expr - array type or map type expression.

Examples:
> SELECT _FUNC_(array('b', 'd', 'c', 'a'));
4
""")
case class Size(child: Expression) extends UnaryExpression with ExpectsInputTypes {
override def dataType: DataType = IntegerType
override def inputTypes: Seq[AbstractDataType] = Seq(TypeCollection(ArrayType, MapType))
Expand Down Expand Up @@ -59,8 +68,17 @@ case class Size(child: Expression) extends UnaryExpression with ExpectsInputType
* Returns an unordered array containing the keys of the map.
*/
@ExpressionDescription(
usage = "_FUNC_(map) - Returns an unordered array containing the keys of the map.",
extended = " > SELECT _FUNC_(map(1, 'a', 2, 'b'));\n [1,2]")
usage = "_FUNC_(expr) - Returns an unordered array containing the keys of the map.",
extended = """
_FUNC_(expr)

Arguments:
expr - map type expression.

Examples:
> SELECT _FUNC_(map(1, 'a', 2, 'b'));
[1,2]
""")
case class MapKeys(child: Expression)
extends UnaryExpression with ExpectsInputTypes {

Expand All @@ -84,7 +102,16 @@ case class MapKeys(child: Expression)
*/
@ExpressionDescription(
usage = "_FUNC_(map) - Returns an unordered array containing the values of the map.",
extended = " > SELECT _FUNC_(map(1, 'a', 2, 'b'));\n [\"a\",\"b\"]")
extended = """
_FUNC_(expr)

Arguments:
expr - map type expression.

Examples:
> SELECT _FUNC_(map(1, 'a', 2, 'b'));
["a","b"]
""")
case class MapValues(child: Expression)
extends UnaryExpression with ExpectsInputTypes {

Expand All @@ -109,8 +136,18 @@ case class MapValues(child: Expression)
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(array(obj1, obj2, ...), ascendingOrder) - Sorts the input array in ascending order according to the natural ordering of the array elements.",
extended = " > SELECT _FUNC_(array('b', 'd', 'c', 'a'), true);\n 'a', 'b', 'c', 'd'")
usage = "_FUNC_(expr, ascendingOrder) - Sorts the input array in ascending order according to the natural ordering of the array elements.",
extended = """
_FUNC_(expr, ascendingOrder)

Arguments:
expr - array type expression.
ascendingOrder - boolean type literal.

Examples:
> SELECT _FUNC_(array('b', 'd', 'c', 'a'), true);
["a","b","c","d"]
""")
// scalastyle:on line.size.limit
case class SortArray(base: Expression, ascendingOrder: Expression)
extends BinaryExpression with ExpectsInputTypes with CodegenFallback {
Expand Down Expand Up @@ -194,8 +231,19 @@ case class SortArray(base: Expression, ascendingOrder: Expression)
* Checks if the array (left) has the element (right)
*/
@ExpressionDescription(
usage = "_FUNC_(array, value) - Returns TRUE if the array contains the value.",
extended = " > SELECT _FUNC_(array(1, 2, 3), 2);\n true")
usage = "_FUNC_(expr1, value) - Returns TRUE if the array contains the value.",
extended = """
_FUNC_(expr1, expr2)

Arguments:
expr1 - array type expression.
expr2 - expression in the element type of expr1 or any type that can be implicitly
converted to the element type of expr1.

Examples:
> SELECT _FUNC_(array(1, 2, 3), 2);
true
""")
case class ArrayContains(left: Expression, right: Expression)
extends BinaryExpression with ImplicitCastInputTypes {

Expand Down