morningman commented on a change in pull request #8567:
URL: https://github.com/apache/incubator-doris/pull/8567#discussion_r832798723
##########
File path: be/src/exec/tablet_sink.cpp
##########
@@ -1189,13 +1197,14 @@ Status OlapTableSink::_validate_data(RuntimeState*
state, RowBatch* batch, Bitma
}
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) {
Review comment:
```suggestion
if (str_val->len > ACTUAL_STRING_TYPE_MAX_LENGTH) {
```
##########
File path: be/src/olap/olap_define.h
##########
@@ -105,6 +102,12 @@ static const uint64_t GB_EXCHANGE_BYTE = 1024 * 1024 *
1024;
// bloom filter fpp
static const double BLOOM_FILTER_DEFAULT_FPP = 0.05;
+#define ACTRUAL_STRING_TYPE_MAX_LENGTH \
Review comment:
`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.
##########
File path: be/src/runtime/types.h
##########
@@ -100,7 +99,7 @@ struct TypeDescriptor {
static TypeDescriptor create_string_type() {
TypeDescriptor ret;
ret.type = TYPE_STRING;
- ret.len = MAX_STRING_LENGTH;
+ ret.len = ACTRUAL_STRING_TYPE_MAX_LENGTH;
Review comment:
Is this compatible with the String that has been created before which
len is already larger than `ACTRUAL_STRING_TYPE_MAX_LENGTH`?
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/analysis/CreateTableStmt.java
##########
@@ -416,7 +416,7 @@ public void analyze(Analyzer analyzer) throws UserException
{
if (distributionDesc == null) {
throw new AnalysisException("Create olap table should contain
distribution desc");
}
- distributionDesc.analyze(columnSet);
+ distributionDesc.analyze(columnSet, columnDefs);
Review comment:
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:
1. stop selecting KEY column when met String column.
2. return error msg to user when the first column is String and give a
suggestion to user.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]