gengliangwang commented on a change in pull request #34370:
URL: https://github.com/apache/spark/pull/34370#discussion_r734662247



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
##########
@@ -1384,6 +1384,16 @@ case class StringLPad(str: Expression, len: Expression, 
pad: Expression = Litera
   override def inputTypes: Seq[AbstractDataType] =
     Seq(TypeCollection(StringType, BinaryType), IntegerType, 
TypeCollection(StringType, BinaryType))
 
+  override def checkInputDataTypes(): TypeCheckResult = {
+    super.checkInputDataTypes() match {

Review comment:
       how about 
   ```
   if str.dataType != pad.dataType 
      TypeCheckFailure ...
   else
       super.checkInputDataTypes()
   ```
   ?




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