You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maxim Gekk (Jira)" <ji...@apache.org> on 2019/10/04 08:59:00 UTC

[jira] [Created] (SPARK-29355) Support timestamps subtraction

Maxim Gekk created SPARK-29355:
----------------------------------

             Summary: Support timestamps subtraction
                 Key: SPARK-29355
                 URL: https://issues.apache.org/jira/browse/SPARK-29355
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Maxim Gekk


||Operator||Example||Result||
|{{+}}|{{date '2001-09-28' + interval '1 hour'}}|{{timestamp '2001-09-28 01:00:00'}}|
|{{-}}|{{date '2001-09-28' - interval '1 hour'}}|{{timestamp '2001-09-27 23:00:00'}}|
|{{-}}|{{timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00'}}|{{interval '1 day 15:00:00'}}|
|{{*}}|{{900 * interval '1 second'}}|{{interval '00:15:00'}}|
|{{*}}|{{21 * interval '1 day'}}|{{interval '21 days'}}|
|{{*}}|{{double precision '3.5' * interval '1 hour'}}|{{interval '03:30:00'}}|
|{{/}}|{{interval '1 hour' / double precision '1.5'}}|{{interval '00:40:00'}}|


https://www.postgresql.org/docs/11/functions-datetime.html



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org