-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[api-change] add soft limit of String type length #8567
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
morningman
left a comment
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.
also need to modify schema change
6505552 to
e7b8239
Compare
be/src/exec/tablet_sink.cpp
Outdated
| case TYPE_STRING: { | ||
| StringValue* str_val = (StringValue*)slot; | ||
| if (str_val->len > OLAP_STRING_MAX_LENGTH) { | ||
| if (str_val->len > ACTRUAL_STRING_TYPE_MAX_LENGTH) { |
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.
| if (str_val->len > ACTRUAL_STRING_TYPE_MAX_LENGTH) { | |
| if (str_val->len > ACTUAL_STRING_TYPE_MAX_LENGTH) { |
be/src/olap/olap_define.h
Outdated
| // bloom filter fpp | ||
| static const double BLOOM_FILTER_DEFAULT_FPP = 0.05; | ||
|
|
||
| #define ACTRUAL_STRING_TYPE_MAX_LENGTH \ |
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.
string_type_length_soft_limit_bytes can be modified by runtime.
If you defined a macro here, then we can't modify it anymore.
the config supports pre-check, see compaction_task_num_per_disk.
We can use pre-check to check if the config value exceed the OLAP_STRING_MAX_LENGTH.
And then, we can use config::string_type_length_soft_limit_bytes directly.
be/src/runtime/types.h
Outdated
| TypeDescriptor ret; | ||
| ret.type = TYPE_STRING; | ||
| ret.len = MAX_STRING_LENGTH; | ||
| ret.len = ACTRUAL_STRING_TYPE_MAX_LENGTH; |
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.
Is this compatible with the String that has been created before which len is already larger than ACTRUAL_STRING_TYPE_MAX_LENGTH?
| throw new AnalysisException("Create olap table should contain distribution desc"); | ||
| } | ||
| distributionDesc.analyze(columnSet); | ||
| distributionDesc.analyze(columnSet, columnDefs); |
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.
There is another place we need to modify in this CreateTableStmt.
When user create a DUPLICATE KEY table without specify the key column, Doris will auto
select part of columns as KEY column.
And if it select a string column as KEY column, the error will return to user.
But this is not what user expected.
We should:
- stop selecting KEY column when met String column.
- return error msg to user when the first column is String and give a suggestion to user.
9dc19f9 to
88691eb
Compare
1. add a config string_type_soft_limit to soft limit max length of string type 2. disable using String type in Key column, partition column and distribution column 3. remove String type alias BLOB for futrue use
morningman
left a comment
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
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
1. add a config string_type_soft_limit to soft limit max length of string type 2. disable using String type in Key column, partition column and distribution column 3. remove String type alias BLOB for futrue use
Proposed changes
distribution column
Problem Summary:
Describe the overview of changes.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...