beliefer commented on a change in pull request #25172: [SPARK-28412][SQL] ANSI
SQL: OVERLAY function support byte array
URL: https://github.com/apache/spark/pull/25172#discussion_r306600072
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
##########
@@ -472,6 +473,20 @@ object Overlay {
builder.append(input.substringSQL(pos + length, Int.MaxValue))
builder.build()
}
+
+ def calculate(input: Array[Byte], replace: Array[Byte], pos: Int, len: Int):
Array[Byte] = {
+ assert(pos > 0, "If you specify `pos`, it must be a positive whole
number.")
Review comment:
If pos is a negative whole number, Postgresql, Oracle, DB2, Vertica all
think as illegal parameter.
OK. I add tests.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]