yaooqinn commented on code in PR #47412:
URL: https://github.com/apache/spark/pull/47412#discussion_r1683737461
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharVarcharUtils.scala:
##########
@@ -270,9 +270,10 @@ object CharVarcharUtils extends Logging with
SparkCharVarcharUtils {
private def padCharToTargetLength(
expr: Expression,
rawType: DataType,
- typeWithTargetCharLength: DataType): Option[Expression] = {
+ typeWithTargetCharLength: DataType,
+ alwaysPad: Boolean): Option[Expression] = {
(rawType, typeWithTargetCharLength) match {
- case (CharType(len), CharType(target)) if target > len =>
+ case (CharType(len), CharType(target)) if alwaysPad || target > len =>
Some(StringRPad(expr, Literal(target)))
Review Comment:
Shall be the bigger number here?
--
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]