Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4945#discussion_r26044965
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -220,6 +220,22 @@ trait HiveTypeCoercion {
                 b.makeCopy(Array(newLeft, newRight))
               }.getOrElse(b)  // If there is no applicable conversion, leave 
expression unchanged.
           }
    +
    +      // Also widen types for InExpressions.
    +      case q: LogicalPlan => q transformExpressions {
    +        // Skip nodes who's children have not been resolved yet.
    +        case e if !e.childrenResolved => e
    +
    +        case i @ In(a, b) if b.exists(_.dataType != a.dataType) =>
    +          b.map(_.dataType).foldLeft(None: Option[DataType])((r, c) => r 
match {
    +            case None => Some(c)
    +            case Some(dt) => findTightestCommonType(dt, c)
    +          }) match {
    +            // If there is no applicable conversion, leave expression 
unchanged.
    +            case None => i.makeCopy(Array(a, b))
    --- End diff --
    
    Leave it as `i` instead of the `i.makeCopy(..)`? Or throwing exception?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to