Daniel-Davies commented on code in PR #38867:
URL: https://github.com/apache/spark/pull/38867#discussion_r1091003986
##########
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:
UNNEST at least has the benefit of being more widely used (at least in my
experience)
ANSI mode as a config option would be ideal (but it seems like quite a high
engineering lift for the benefits); and I suppose posexplode being the only
function- outside of "get"- using 0 based indexing isn't the end of the world
from my perspective (name not as widely recognised, and also probably not as
frequently used as regular explode, but I don't have any data on that)
It sounds like we want to probably make array_insert 1 indexed from the
above; I'll await confirmation from some of the previous commenters before
changing the code
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]