Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(static): support for partial datetimes on WindowStart bounds #3435

Merged

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Sep 27, 2019

Description

With the change you no longer need to supply the full datetime when adding bounds on WindowStart. You can drop precision on the right as much as you like, all the way until you have only a year. For example,

SELECT * FROM AGGREGATE WHERE '2020-02-23T23:45' <= WindowStart AND WindowStart < '2020-02-23T24' AND ROWKEY='10';

Numeric timezones are now also supported

SELECT * FROM AGGREGATE WHERE ROWKEY='10' AND WindowStart='2020-02-23T22:45:12.000-0100';

cc @derekjn , @MichaelDrogalis

This also fixes a bug in the original Rowtime rewriter code where it was ignoring the time part of datetimes.

Testing done

usual

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

With the change you no longer need to supply the full datetime when adding bounds on `WindowStart`.  You can drop precision on the right as much as you like, all the way until you have only a year. For example,

```sql
SELECT * FROM AGGREGATE WHERE '2020-02-23T23:45' <= WindowStart AND WindowStart < '2020-02-23T24' AND ROWKEY='10';
```

Numeric timezones are now also supported

```sql
SELECT * FROM AGGREGATE WHERE ROWKEY='10' AND WindowStart='2020-02-23T22:45:12.000-0100';
```
Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed the actual parse code since it looks like its just moved over from the rewriter. Otherwise LGTM.

@big-andy-coates big-andy-coates merged commit 99f6e24 into confluentinc:master Sep 27, 2019
@big-andy-coates big-andy-coates deleted the static_partital_dates branch September 27, 2019 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants