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

    https://github.com/apache/spark/pull/13651#discussion_r67052047
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala
 ---
    @@ -630,6 +640,25 @@ class TypeCoercionSuite extends PlanTest {
             Seq(Cast(Literal(1), StringType), Cast(Literal("b"), StringType)))
         )
       }
    +
    +  test("SPARK-15776 Divide expression's dataType should be casted to 
Double or Decimal") {
    +    val analyzer = new RuleExecutor[LogicalPlan] {
    +      override val batches =
    +        Seq(Batch("Resolution", FixedPoint(10), 
FunctionArgumentConversion, Division))
    +    }
    +
    +    // Cast integer to double
    +    ruleTest(analyzer, sum(Divide(4, 3)), sum(Divide(Cast(4, DoubleType), 
Cast(3, DoubleType))))
    +    // left expression is already Double, skip
    --- End diff --
    
    what if left expression is int and right expression is double?


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