Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6405#discussion_r31150256
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -408,7 +408,7 @@ trait HiveTypeCoercion {
             Union(newLeft, newRight)
     
           // fix decimal precision for expressions
    -      case q => q.transformExpressions {
    +      case q => q.transformExpressionsUp {
    --- End diff --
    
    Since we separate type checking logic from `resolved`,  we need to ensure 
all children have valid input types before we do type coercion(think about 
`Add(Add(decimal1, decimal2), decimal3)`). Here I just use 
`transformExpressionsUp` as a quick fix(and only for `DecimalPrecision` rule as 
it breaks a test...), should we skip not only `!childrenResolved` but also 
`!children.forall(_.validInputTypes)` during all type coercion, or still 
checking types in `resolved`? @rxin @marmbrus 


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