You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/25 04:28:00 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #37652: [SPARK-40214][PYTHON][SQL] add 'get' to functions
HyukjinKwon commented on code in PR #37652:
URL: https://github.com/apache/spark/pull/37652#discussion_r954489472
##########
sql/core/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -3958,6 +3958,26 @@ object functions {
ElementAt(column.expr, lit(value).expr)
}
+ /**
+ * Returns element of array at given (0-based) index. If the index points
+ * outside of the array boundaries, then this function returns NULL.
+ *
+ * @group collection_funcs
+ * @since 3.4.0
+ */
+ def get(column: Column, index: Column): Column = withExpr {
+ new Get(column.expr, index.expr)
+ }
+
+ /**
+ * Returns element of array at given (0-based) index. If the index points
+ * outside of the array boundaries, then this function returns NULL.
+ *
+ * @group collection_funcs
+ * @since 3.4.0
+ */
+ def get(column: Column, index: Int): Column = get(column, lit(index))
Review Comment:
Let's probably don't add this (see the comments on the top of this file)
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org