feat: support customizing column default values for inserting#8283
Merged
alamb merged 11 commits intoapache:mainfrom Nov 22, 2023
Merged
feat: support customizing column default values for inserting#8283alamb merged 11 commits intoapache:mainfrom
alamb merged 11 commits intoapache:mainfrom
Conversation
comphead
reviewed
Nov 20, 2023
comphead
reviewed
Nov 20, 2023
comphead
reviewed
Nov 21, 2023
| Ok(Schema::new(fields)) | ||
| } | ||
|
|
||
| pub(super) fn build_column_defaults( |
Contributor
There was a problem hiding this comment.
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<>
Member
Author
There was a problem hiding this comment.
A comment has been added for this.
The main reason is that Hashmap has not implemented the Hash trait, which is required by CreateMemoryTable.
comphead
reviewed
Nov 21, 2023
Contributor
|
Thanks @jonahgao I think we're very close |
Co-authored-by: comphead <comphead@users.noreply.github.com>
7 tasks
Member
Author
|
Thank you for reviewing @comphead |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.