cloud-fan commented on code in PR #47412:
URL: https://github.com/apache/spark/pull/47412#discussion_r1683740859
##########
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 =>
Review Comment:
we don't need to. This is the existing logic. My change is always pad as the
CHAR value may not be padded to its declared length.
--
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]