cloud-fan commented on code in PR #40633:
URL: https://github.com/apache/spark/pull/40633#discussion_r1156592711
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:
##########
@@ -1107,10 +1107,12 @@ object TypeCoercion extends TypeCoercionBase {
case e if !e.childrenResolved => e
case a @ BinaryArithmetic(left @ StringType(), right)
- if right.dataType != CalendarIntervalType =>
+ if right.dataType != CalendarIntervalType &&
+ !right.dataType.isInstanceOf[AnsiIntervalType] =>
a.makeCopy(Array(Cast(left, DoubleType), right))
case a @ BinaryArithmetic(left, right @ StringType())
- if left.dataType != CalendarIntervalType =>
+ if left.dataType != CalendarIntervalType &&
+ !left.dataType.isInstanceOf[AnsiIntervalType] =>
Review Comment:
good point. For `interval * string`, there seems to be only one choice: the
string should be a number.
--
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]