-
Couldn't load subscription status.
- Fork 1.7k
feat: support customizing column default values for inserting #8283
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
Conversation
| Ok(Schema::new(fields)) | ||
| } | ||
|
|
||
| pub(super) fn build_column_defaults( |
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 be nice to explain in comments what exactly gets returned in the tuple for future readers, like <column name, expr>
I'm even thinking should be that be a map instead of Vec<>
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.
A comment has been added for this.
The main reason is that Hashmap has not implemented the Hash trait, which is required by CreateMemoryTable.
|
Thanks @jonahgao I think we're very close |
Co-authored-by: comphead <[email protected]>
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 thanks @jonahgao for supporting custom default values
|
Thank you for reviewing @comphead |
Which issue does this PR close?
This is a continuation of #8146.
Rationale for this change
Currently, we only support NULL as the default value for columns.
This pr will enable users to customize the default value while creating a table.
For example:
What changes are included in this PR?
CreateMemoryTableplan.TableSource.MemTablefor verification.Are these changes tested?
Yes
Are there any user-facing changes?
Yes.
TableSourceandTableProvider, but provided default implementations.column_defaultsin the structCreateMemoryTable.