Github user dilipbiswal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16954#discussion_r103362319
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
 ---
    @@ -123,19 +123,36 @@ case class Not(child: Expression)
      */
     @ExpressionDescription(
       usage = "expr1 _FUNC_(expr2, expr3, ...) - Returns true if `expr` equals 
to any valN.")
    -case class In(value: Expression, list: Seq[Expression]) extends Predicate
    -    with ImplicitCastInputTypes {
    +case class In(value: Expression, list: Seq[Expression]) extends Predicate {
     
       require(list != null, "list should not be null")
    -
    -  override def inputTypes: Seq[AbstractDataType] = value.dataType +: 
list.map(_.dataType)
    -
       override def checkInputDataTypes(): TypeCheckResult = {
    -    if (list.exists(l => l.dataType != value.dataType)) {
    -      TypeCheckResult.TypeCheckFailure(
    -        "Arguments must be same type")
    -    } else {
    -      TypeCheckResult.TypeCheckSuccess
    +    list match {
    +      case ListQuery(sub, _, _) :: Nil =>
    --- End diff --
    
    @hvanhovell Actually previously checkInputDataTypes() called from 
checkAnalysis never had to deal with **In subquery expressions** as it gets 
rewritten to PredicateSubquery. With the change in this PR we now see the 
original IN subquery expressions and thus we need to make sure the types are 
same between LHS and RHS of the IN subquery expression.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to