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
chore: add current_timestamp function #13751
Conversation
CI failed https://github.com/datafuselabs/databend/actions/runs/6899767394/job/18772060466?pr=13751 [SQL] create table db2.test6(id Int8, created timestamp DEFAULT CURRENT_TIMESTAMP) Error: SelfError("sqllogictest failed") |
Will literal And we could add test for select CURRENT_TIMESTAMP; -- not supported yet
select CURRENT_TIMESTAMP(); |
Literal::CurrentTimestamp => Err(ErrorCode::SemanticError(format!( | ||
"Unsupported literal value: {literal}" | ||
)))?, | ||
Literal::CurrentTimestamp => Scalar::Timestamp(Local::now().timestamp_micros()), |
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.
Literal::CurrentTimestamp => Scalar::Timestamp(Local::now().timestamp_micros()), | |
Literal::CurrentTimestamp => self.resolve_function(*span, "CURRENT_TIMESTAMP", vec![], vec![]) | |
.await |
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.
resolve_function
is an async function.
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.
resolve_scalar_function_call
could change to be sync function.
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
chore: add current_timestamp function
This change is