[feat](expression support for default value) Add expression-based column default values#64621
Open
nooneuse wants to merge 3 commits into
Open
[feat](expression support for default value) Add expression-based column default values#64621nooneuse wants to merge 3 commits into
nooneuse wants to merge 3 commits into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 28641 ms |
Contributor
TPC-DS: Total hot run time: 173798 ms |
Contributor
ClickBench: Total hot run time: 25.06 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
Author
|
run buildall |
Contributor
Author
|
run buildall |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
TPC-H: Total hot run time: 29180 ms |
Contributor
TPC-DS: Total hot run time: 175576 ms |
Contributor
ClickBench: Total hot run time: 25.2 s |
Contributor
TPC-H: Total hot run time: 29239 ms |
Contributor
TPC-DS: Total hot run time: 175219 ms |
Contributor
ClickBench: Total hot run time: 25.4 s |
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.
What problem does this PR solve?
Issue Number: close #64635
Related PR: Not yet
Problem Summary:
How to use
Example (date/datetime defaults):
d DATEV2 NOT NULL DEFAULT to_date(now())dt DATETIMEV2(3) NOT NULL DEFAULT now(3)Example (composed string default):
s STRING NOT NULL DEFAULT concat('a-', DATE_FORMAT(now(), '%M %e, %Y'))Main limitations / constraints
The default expression must be analyzable and side-effect free:
Non-deterministic functions are restricted:
Type must be compatible:
Default value behavior in different scenarios
INSERT without specifying the column:
DEFAULT(calculated at write time).INSERT explicitly providing a value:
DEFAULTis not applied.When DEFAULT (expression) may not take effect
MoW unique-key partial update (
UPDATE_FIXED_COLUMNS/UPDATE_FLEXIBLE_COLUMNS):DEFAULTis defined as an expression (i.e. a calculated default), partial update is rejected by default to avoid ambiguous default-filling.allow_partial_update_with_expression_default=true, which allows the load/insert to proceed and fills missing columns using schema defaults (for default expressions, using pre-folded literalrealDefaultValue), rather than evaluating the expression at runtime.Read paths (old segments / schema changing / point query / row store):
DEFAULTexpressions are not evaluated at read time.realDefaultValue, rather than evaluating the expression at runtime.Release note
DEFAULTis defined as an expression. Whenallow_partial_update_with_expression_default=trueis enabled, the request is allowed and missing columns are filled using the pre-folded literalrealDefaultValue(i.e. the stored calculated default), rather than evaluating the expression at runtime.Check List (For Author)
Test
Behavior changed:
No.
Yes.
Does this need documentation?
Check List (For Reviewer who merge this PR)