cloud-fan commented on a change in pull request #28572: URL: https://github.com/apache/spark/pull/28572#discussion_r427278465
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ########## @@ -1735,8 +1735,22 @@ case class AnsiCast(child: Expression, dataType: DataType, timeZoneId: Option[St /** * Cast the child expression to the target data type, but will throw error if the cast might * truncate, e.g. long -> int, timestamp -> data. + * + * Note that UpCast will be eliminated if the child's dataType is already DecimalType and Review comment: We can simplify the doc: ``` Note: `target` is `AbstractDataType`, so that we can put `object DecimalType`, which means we accept `DecimalType` with any valid precision/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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org