chaoyli closed pull request #524: Fix bug that schema change does not set null value correctly URL: https://github.com/apache/incubator-doris/pull/524
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/be/src/olap/column_reader.cpp b/be/src/olap/column_reader.cpp index 38e9cd35..13f7c6ae 100644 --- a/be/src/olap/column_reader.cpp +++ b/be/src/olap/column_reader.cpp @@ -641,7 +641,6 @@ ColumnReader* ColumnReader::create(uint32_t column_id, field_info.default_value, field_info.type, field_info.length); } } else if (field_info.is_allow_null) { - LOG(WARNING) << "create NullValueReader: " << field_info.name; return new(std::nothrow) NullValueReader(column_id, column_unique_id); } else { OLAP_LOG_WARNING("not null field has no default value"); diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp index a5c2a2c1..2e9c6151 100644 --- a/be/src/olap/schema_change.cpp +++ b/be/src/olap/schema_change.cpp @@ -2358,7 +2358,7 @@ OLAPStatus SchemaChangeHandler::_init_column_mapping(ColumnMapping* column_mappi return OLAP_ERR_MALLOC_ERROR; } - if (true == column_schema.is_allow_null && value.length() == 0) { + if (column_schema.is_allow_null && !column_schema.has_default_value) { column_mapping->default_value->set_null(); } else { column_mapping->default_value->from_string(value); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org