Skip to content

Commit c7e2dee

Browse files
committed
address PR comments
1 parent 14ef371 commit c7e2dee

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -443,26 +443,24 @@ case class ArrayAggregate(
443443
override def prettyName: String = "aggregate"
444444
}
445445

446-
/**
447-
* Transform elements in an array using the transform function. This is similar to
448-
* a `map` in functional programming.
449-
*/
450446
// scalastyle:off line.size.limit
451447
@ExpressionDescription(
452-
usage = "_FUNC_(expr, func) - Merges the two given arrays, element-wise, into a single array using function. If one array is shorter, nulls are appended at the end to match the length of the longer array, before applying function.",
448+
usage = "_FUNC_(left, right, func) - Merges the two given arrays, element-wise, into a single array using function. If one array is shorter, nulls are appended at the end to match the length of the longer array, before applying function.",
453449
examples = """
454450
Examples:
455-
> SELECT _FUNC_(array(1, 2, 3), x -> x + 1);
456-
array(2, 3, 4)
457-
> SELECT _FUNC_(array(1, 2, 3), (x, i) -> x + i);
458-
array(1, 3, 5)
451+
> SELECT _FUNC_(array(1, 2, 3), array('a', 'b', 'c'), (x, y) -> (y, x));
452+
array(('a', 1), ('b', 3), ('c', 5))
453+
> SELECT _FUNC_(array(1, 2), array(3, 4), (x, y) -> x + y));
454+
array(4, 6)
455+
> SELECT _FUNC_(array('a', 'b', 'c'), array('d', 'e', 'f'), (x, y) -> concat(x, y));
456+
array('ad', 'be', 'cf')
459457
""",
460458
since = "2.4.0")
461459
// scalastyle:on line.size.limit
462460
case class ArraysZipWith(
463-
left: Expression,
464-
right: Expression,
465-
function: Expression)
461+
left: Expression,
462+
right: Expression,
463+
function: Expression)
466464
extends HigherOrderFunction with CodegenFallback with ExpectsInputTypes {
467465

468466
override def inputs: Seq[Expression] = List(left, right)

0 commit comments

Comments
 (0)