Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Implement Set Operators for Time Types #19

Open
16 tasks
chaitan94 opened this issue Aug 12, 2020 · 0 comments
Open
16 tasks

Implement Set Operators for Time Types #19

chaitan94 opened this issue Aug 12, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed

Comments

@chaitan94
Copy link
Member

• +: Union of the time values
• *: Intersection of the time values
• -: Difference of the time values

We can override the respective operators in both C++ and Python
Invalid operations should throw accordingly

Todo Checklist

  • TimestampSet, TimestampSet
    • Union
    • Intersection
    • Difference
  • Period, Period
    • Union
    • Intersection
    • Difference
  • PeriodSet, PeriodSet
    • Union
    • Intersection
    • Difference
  • PeriodSet, Period
    • Union
    • Intersection
    • Difference

Sample MobilityDB queries for reference/test cases

mobilitydb=# select period '[2020-01-01, 2020-01-10]';
                      period                      
--------------------------------------------------
 [2020-01-01 00:00:00+00, 2020-01-10 00:00:00+00]
(1 row)

mobilitydb=# select period '[2020-01-01, 2020-01-10]' + '[2020-01-08, 2020-01-10]';
                      ?column?                      
----------------------------------------------------
 {[2020-01-01 00:00:00+00, 2020-01-10 00:00:00+00]}
(1 row)

mobilitydb=# select period '[2020-01-01, 2020-01-10]' + '[2020-01-08, 2020-01-12]';
                      ?column?                      
----------------------------------------------------
 {[2020-01-01 00:00:00+00, 2020-01-12 00:00:00+00]}
(1 row)

mobilitydb=# select period '[2020-01-01, 2020-01-10]' + '[2020-01-18, 2020-01-20]';
                                               ?column?                                               
------------------------------------------------------------------------------------------------------
 {[2020-01-01 00:00:00+00, 2020-01-10 00:00:00+00], [2020-01-18 00:00:00+00, 2020-01-20 00:00:00+00]}
(1 row)
@chaitan94 chaitan94 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant