AngersZhuuuu commented on a change in pull request #33661:
URL: https://github.com/apache/spark/pull/33661#discussion_r684783328



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -840,10 +840,17 @@ abstract class BinaryComparison extends BinaryOperator 
with Predicate {
 
   final override val nodePatterns: Seq[TreePattern] = Seq(BINARY_COMPARISON)
 
-  override def checkInputDataTypes(): TypeCheckResult = 
super.checkInputDataTypes() match {
-    case TypeCheckResult.TypeCheckSuccess =>
-      TypeUtils.checkForOrderingExpr(left.dataType, 
this.getClass.getSimpleName)
-    case failure => failure
+  override def checkInputDataTypes(): TypeCheckResult = {
+    val matched = (left.dataType, right.dataType) match {
+      case (l: DayTimeIntervalType, r: DayTimeIntervalType) => 
TypeCheckResult.TypeCheckSuccess

Review comment:
       > It's a bit weird that we allow different types in binary comparison. 
Can we fix the type coercion instead? e.g. 
`TypeCoercion.findTightestCommonType`. This is also more general, we can also 
support `coalesce(interval1, interval2)`
   
   Hmm like current?




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