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

    https://github.com/apache/spark/pull/1557#discussion_r15326955
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -306,6 +307,23 @@ trait HiveTypeCoercion {
       }
     
       /**
    +   * Hive only performs integral division with the DIV operator. The 
arguments to / are always
    +   * converted to fractional types.
    +   */
    +  object Division extends Rule[LogicalPlan] {
    +    def apply(plan: LogicalPlan): LogicalPlan = plan 
transformAllExpressions {
    +      // Skip nodes who's children have not been resolved yet.
    +      case e if !e.childrenResolved => e
    +
    +      // Decimal and Double remain the same
    +      case d: Divide if d.dataType == DoubleType => d
    +      case d: Divide if d.dataType == DecimalType => d
    --- End diff --
    
    Please ignore my comment. I think we should not add `case d: Divide if 
d.dataType == FloatType => d`.


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

Reply via email to