Github user dongjoon-hyun commented on the pull request:

    https://github.com/apache/spark/pull/12376#issuecomment-209828163
  
    Hi, @markhamstra ! Thank you for commenting. 
    
    I agree with your viewpoint. So, this PR has a meaning to add just a 
function, `bround`; not a HQL language level meaning. In terms of semantics, 
this is the same implementation with Hive. The following is [Hive code from the 
Hive master 
branch](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/RoundUtils.java).
    ```java
    public static double bround(double input, int scale) {
        if (Double.isNaN(input) || Double.isInfinite(input)) {
          return input;
        }
        return BigDecimal.valueOf(input).setScale(scale, 
RoundingMode.HALF_EVEN).doubleValue();
      }
    ```
    
    By the way, for the last issue, I think in a different way.
    Since Spark SQL becomes less directly dependent on Hive, we need to provide 
this as a Spark SQL function.


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