-
Notifications
You must be signed in to change notification settings - Fork 589
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: introduce PROCTIME() #9088
Conversation
Codecov Report
@@ Coverage Diff @@
## main #9088 +/- ##
========================================
Coverage 70.87% 70.88%
========================================
Files 1197 1198 +1
Lines 199011 199125 +114
========================================
+ Hits 141057 141148 +91
- Misses 57954 57977 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please add some tests? Rest LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Can not wait to use PROCTIME()
to represent the process time temporal join syntax instead of NOW()
. 😄
fn return_type(&self) -> DataType { | ||
DataType::Timestamptz | ||
} | ||
|
||
async fn eval_v2(&self, input: &DataChunk) -> Result<ValueImpl> { | ||
let proctime = CONTEXT | ||
.try_with(|context| context.get_physical_time()) | ||
.map_err(|_| ExprError::Context)?; | ||
let datum = Some(ScalarImpl::Int64(proctime as i64)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamptz
is in microseconds but seems Epoch::physical_time
is in milliseconds? And it seems to be since risingwave epoch rather than unix epoch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The interfaces of Epoch
are ambiguous without including the time unit in the names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix in #9126
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist For Contributors
- [ ] I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934)../risedev check
(or alias,./risedev c
)Checklist For Reviewers
Documentation
Click here for Documentation
Types of user-facing changes
We can define a processing time on TABLE/SOURCE, which reflects the time a record is inserted in RisingWave.
Release note