Github user yijieshen commented on the pull request:

    https://github.com/apache/spark/pull/6938#issuecomment-118488908
  
    udf_round_3 and expected output:
    ```
    -- test for TINYINT
    select round(-128), round(127), round(0) from src tablesample (1 rows);
    
    -- test for SMALLINT
    select round(-32768), round(32767), round(-129), round(128) from src 
tablesample (1 rows);
    
    -- test for INT
    select round(cast(negative(pow(2, 31)) as INT)), round(cast((pow(2, 31) - 
1) as INT)), round(-32769), round(32768) from src tablesample (1 rows);
    
    -- test for BIGINT
    select round(cast(negative(pow(2, 63)) as BIGINT)), round(cast((pow(2, 63) 
- 1) as BIGINT)), round(cast(negative(pow(2, 31) + 1) as BIGINT)), 
round(cast(pow(2, 31) as BIGINT)) from src tablesample (1 rows);
    
    -- test for DOUBLE
    select round(126.1), round(126.7), round(32766.1), round(32766.7) from src 
tablesample (1 rows);
    ```
    
    ```
    -128        127     0
    -32768      32767   -129    128
    -2147483648 2147483647      -32769  32768
    -9223372036854775808        9223372036854775807     -2147483649     
2147483648
    126.0       127.0   32766.0 32767.0
    ```



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