cloud-fan commented on a change in pull request #34462:
URL: https://github.com/apache/spark/pull/34462#discussion_r740747727



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
##########
@@ -643,15 +643,14 @@ object StructType extends AbstractDataType {
         DecimalType.Fixed(rightPrecision, rightScale)) =>
         if ((leftPrecision == rightPrecision) && (leftScale == rightScale)) {

Review comment:
       how about this
   ```
   if(leftScale == rightScale) {
     DecimalType(leftPrecision.max(rightPrecision), leftScale)
   } else {
     throw 
QueryExecutionErrors.cannotMergeDecimalTypesWithIncompatibleScaleError
   }
   ```
   
   I think we don't need to have two different error messages. We just need to 
point out the root cause, which is the incompatible scale.




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