ueshin commented on a change in pull request #29138:
URL: https://github.com/apache/spark/pull/29138#discussion_r456173962
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -3406,6 +3406,24 @@ object functions {
Slice(x.expr, Literal(start), Literal(length))
}
+ /**
+ * Returns an array containing all the elements in `x` from index `start`
(or starting from the
+ * end if `start` is negative) with the specified `length`.
+ *
+ * @param x the array column to be sliced
+ * @param start the starting index
+ * @param length the length of the slice
+ *
+ * @group collection_funcs
+ * @since 2.4.0
Review comment:
`3.1.0`?
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -3406,6 +3406,24 @@ object functions {
Slice(x.expr, Literal(start), Literal(length))
}
+ /**
+ * Returns an array containing all the elements in `x` from index `start`
(or starting from the
+ * end if `start` is negative) with the specified `length`.
+ *
+ * @param x the array column to be sliced
+ * @param start the starting index
+ * @param length the length of the slice
+ *
+ * @group collection_funcs
+ * @since 2.4.0
+ */
+ def slice(x: Column, start: Any, length: Any): Column = (start, length)
match {
Review comment:
I'm afraid I don't think we should use `Any` here.
Maybe `def slice(x: Column, start: Column, length: Column): Column` is good
enough?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]