mihailom-db commented on code in PR #46003:
URL: https://github.com/apache/spark/pull/46003#discussion_r1568809481


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala:
##########
@@ -48,6 +48,10 @@ object CollationTypeCasts extends TypeCoercionRule {
     case eltExpr: Elt =>
       eltExpr.withNewChildren(eltExpr.children.head +: 
collateToSingleType(eltExpr.children.tail))
 
+    case overlay: Overlay =>
+      overlay.withNewChildren(collateToSingleType(Seq(overlay.input, 
overlay.replace))
+        ++ Seq(overlay.pos, overlay.len))

Review Comment:
   Interesting thought/question: I do not know what Scala does when it calls 
Seq, but you can do single element append with :+. This operator seems to only 
allocate memory for 1 element and then write it to that place, while ++ 
allocates memory for all and then call Array.copy(...) for elements that need 
to be added. @cloud-fan Do you maybe know something a bit more on this topic?



-- 
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]

Reply via email to