GideonPotok commented on code in PR #46041:
URL: https://github.com/apache/spark/pull/46041#discussion_r1572135059


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala:
##########
@@ -54,7 +54,7 @@ object CollationTypeCasts extends TypeCoercionRule {
 
     case otherExpr @ (
       _: In | _: InSubquery | _: CreateArray | _: ArrayJoin | _: Concat | _: 
Greatest | _: Least |
-      _: Coalesce | _: BinaryExpression | _: ConcatWs) =>
+      _: Coalesce | _: BinaryExpression | _: ConcatWs | _: StringLPad | _: 
StringRPad) =>

Review Comment:
   @uros-db  That is not so, in my understanding.
   
   `collateToSingleType` calls  `getOutputCollation`  and then does     
`exprs.map(e => castStringType(e, st).getOrElse(e))`
   
   `getOutputCollation`, according to the function comment blocks (verified by 
me looking at the code), "will only be affected by collated StringTypes or 
complex DataTypes with collated StringTypes (e.g. ArrayType)"
   
   
   `castStringType` , according to the function comment blocks (verified by me 
looking at the code), "casts given expression to collated StringType with id 
equal to collationId only if expression has StringType in the first place."



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to