Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/22395
  
    why are we always returning long type here? shouldn't they be the same as 
the left expr's type? see mysql
    
    ```mysql> create temporary table rxin_temp select 4 div 2, 123456789124 div 
2, 4 / 2, 123456789124 / 2;
    Query OK, 1 row affected (0.02 sec)
    Records: 1  Duplicates: 0  Warnings: 0
    
    mysql> describe rxin_temp;
    +--------------------+---------------+------+-----+---------+-------+
    | Field              | Type          | Null | Key | Default | Extra |
    +--------------------+---------------+------+-----+---------+-------+
    | 4 div 2            | int(1)        | YES  |     | NULL    |       |
    | 123456789124 div 2 | bigint(12)    | YES  |     | NULL    |       |
    | 4 / 2              | decimal(5,4)  | YES  |     | NULL    |       |
    | 123456789124 / 2   | decimal(16,4) | YES  |     | NULL    |       |
    +--------------------+---------------+------+-----+---------+-------+
    4 rows in set (0.01 sec)```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to