You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/22 15:53:30 UTC

[GitHub] [spark] gengliangwang commented on a change in pull request #34370: [SPARK-37047][SQL][FOLLOWUP] lpad/rpad should fail if parameter str and pad are different types

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: reviews-unsubscribe@spark.apache.org

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



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