Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/14786
  
    MySQL and PostgreSQL support this
    
    **MySQL**
    
    - Greatest/leastest
    
    ```sql
    mysql> SELECT GREATEST(CAST("1990-02-24 12:00:00" AS DATETIME), 
CAST("1990-02-25" AS DATE));
    
+-------------------------------------------------------------------------------+
    | GREATEST(CAST("1990-02-24 12:00:00" AS DATETIME), CAST("1990-02-25" AS 
DATE)) |
    
+-------------------------------------------------------------------------------+
    | 1990-02-25 00:00:00                                                       
    |
    
+-------------------------------------------------------------------------------+
    ```
    
    - Union
    
    ```sql
    mysql> SELECT CAST("1990-02-24 12:00:00" AS DATETIME) UNION SELECT 
CAST("1990-02-24" AS DATE);
    +-----------------------------------------+
    | CAST("1990-02-24 12:00:00" AS DATETIME) |
    +-----------------------------------------+
    | 1990-02-24 12:00:00                     |
    | 1990-02-24 00:00:00                     |
    +-----------------------------------------+
    ```
    
    **PostgreSQL**
    
    - Greatest/leatest
    
    ```sql
    postgres=# SELECT GREATEST(CAST('1990-02-24 12:00:00' AS TIMESTAMP), 
CAST('1990-02-25' AS DATE));
          greatest
    ---------------------
     1990-02-25 00:00:00
    (1 row)
    ```
    
    - Union
    
    ```sql
    postgres=# SELECT CAST('1990-02-24 12:00:00' AS TIMESTAMP) UNION SELECT 
CAST('1990-02-24' AS DATE);
          timestamp
    ---------------------
     1990-02-24 00:00:00
     1990-02-24 12:00:00
    (2 rows)
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to