You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "srielau (via GitHub)" <gi...@apache.org> on 2023/01/30 17:06:18 UTC
[GitHub] [spark] srielau commented on a diff in pull request #38867: [SPARK-41234][SQL][PYTHON] Add `array_insert` function
srielau commented on code in PR #38867:
URL: https://github.com/apache/spark/pull/38867#discussion_r1090906741
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala:
##########
@@ -4601,6 +4601,247 @@ case class ArrayExcept(left: Expression, right: Expression) extends ArrayBinaryL
newLeft: Expression, newRight: Expression): ArrayExcept = copy(left = newLeft, right = newRight)
}
+@ExpressionDescription(
+ usage = "_FUNC_(x, pos, val) - Places val into index pos of array x (array indices start at 0)",
Review Comment:
ANSI SQL is 1-based. Note that one based indexing is critical to exploit relative indexing counting from the end.
That's used frequently in SparkSQL for STRINGs and getting more common fro ARRAYs.
--
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