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

bug: cannot create table with column with default value of NOW() #9873

Closed
BugenZhao opened this issue May 17, 2023 · 0 comments · Fixed by #10086
Closed

bug: cannot create table with column with default value of NOW() #9873

BugenZhao opened this issue May 17, 2023 · 0 comments · Fixed by #10086
Assignees
Labels
component/common Common components, such as array, data chunk, expression. component/func-expr Support a SQL function or operator type/bug Something isn't working
Milestone

Comments

@BugenZhao
Copy link
Member

In #9609, we removed NOW from the expression proto as it'll never be used by the execution. However, Since we've recently supported non-NULL default values, it's possible that we specify NOW as the default value, then it must be persisted in the catalog.

So we have to introduce NOW in proto again. But the fact that it corresponds to no backend execution function won't change.

impl Expr for Now {
fn return_type(&self) -> DataType {
DataType::Timestamptz
}
fn to_expr_proto(&self) -> ExprNode {
unreachable!(
"`Now` should be translated to `Literal` in batch mode or `NowNode` in stream mode"
)
}
}

@BugenZhao BugenZhao added type/bug Something isn't working component/common Common components, such as array, data chunk, expression. component/func-expr Support a SQL function or operator labels May 17, 2023
@github-actions github-actions bot added this to the release-0.20 milestone May 17, 2023
@y-wei y-wei self-assigned this May 18, 2023
@y-wei y-wei linked a pull request May 31, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/common Common components, such as array, data chunk, expression. component/func-expr Support a SQL function or operator type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants