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

    https://github.com/apache/spark/pull/7087#discussion_r33508451
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -131,20 +131,22 @@ trait HiveTypeCoercion {
           // Don't propagate types from unresolved children.
           case q: LogicalPlan if !q.childrenResolved => q
     
    -      case q: LogicalPlan => q transformExpressions {
    -        case a: AttributeReference =>
    -          q.inputSet.find(_.exprId == a.exprId) match {
    -            // This can happen when a Attribute reference is born in a 
non-leaf node, for example
    -            // due to a call to an external script like in the Transform 
operator.
    -            // TODO: Perhaps those should actually be aliases?
    -            case None => a
    -            // Leave the same if the dataTypes match.
    -            case Some(newType) if a.dataType == newType.dataType => a
    -            case Some(newType) =>
    -              logDebug(s"Promoting $a to $newType in ${q.simpleString}}")
    -              newType
    -          }
    -      }
    +      case q: LogicalPlan =>
    +        val inputMap = q.inputSet.toAttributeMap(a => a)
    --- End diff --
    
    I'd like to build a map by `q.inputSet.toSeq.map(a => (a.exprId, 
a)).toMap`, not to introduce a new API in AttributeSet


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