Skip to content

Commit

Permalink
Merge branch 'branch-2.0' into fix_modify_storage_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnnyssc authored May 24, 2024
2 parents 8fce17f + 4cb9350 commit 5caada9
Show file tree
Hide file tree
Showing 42 changed files with 1,350 additions and 324 deletions.
2 changes: 1 addition & 1 deletion be/src/clucene
15 changes: 15 additions & 0 deletions be/src/common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,21 @@ inline std::string Status::to_string() const {
} \
} while (false)

#define PROPAGATE_FALSE(stmt) \
do { \
if (UNLIKELY(!static_cast<bool>(stmt))) { \
return false; \
} \
} while (false)

#define THROW_IF_ERROR(stmt) \
do { \
Status _status_ = (stmt); \
if (UNLIKELY(!_status_.ok())) { \
throw Exception(_status_); \
} \
} while (false)

#define RETURN_ERROR_IF_NON_VEC \
return Status::NotSupported("Non-vectorized engine is not supported since Doris 2.0.");

Expand Down
2 changes: 1 addition & 1 deletion be/src/io/fs/broker_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ Status BrokerFileSystem::download_impl(const Path& remote_file, const Path& loca
write_offset += read_len;
} // file_handler should be closed before calculating checksum

return Status::OK();
return local_writer->close();
}

Status BrokerFileSystem::direct_download_impl(const Path& remote_file, std::string* content) {
Expand Down
5 changes: 2 additions & 3 deletions be/src/olap/inverted_index_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ std::string get_parser_ignore_above_value_from_properties(
template <bool ReturnTrue = false>
std::string get_parser_lowercase_from_properties(
const std::map<std::string, std::string>& properties) {
DBUG_EXECUTE_IF("inverted_index_parser.get_parser_lowercase_from_properties", { return ""; })

if (properties.find(INVERTED_INDEX_PARSER_LOWERCASE_KEY) != properties.end()) {
return properties.at(INVERTED_INDEX_PARSER_LOWERCASE_KEY);
} else {
DBUG_EXECUTE_IF("inverted_index_parser.get_parser_lowercase_from_properties",
{ return ""; })

if constexpr (ReturnTrue) {
return INVERTED_INDEX_PARSER_TRUE;
} else {
Expand Down
13 changes: 10 additions & 3 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,22 @@ void TabletIndex::to_schema_pb(TabletIndexPB* index) const {
}
index->set_index_type(_index_type);
for (const auto& kv : _properties) {
DBUG_EXECUTE_IF("tablet_schema.to_schema_pb", {
if (kv.first == INVERTED_INDEX_PARSER_LOWERCASE_KEY) {
continue;
}
})
(*index->mutable_properties())[kv.first] = kv.second;
}

DBUG_EXECUTE_IF("tablet_schema.to_schema_pb", { return; })

// lowercase by default
if (!_properties.contains(INVERTED_INDEX_PARSER_LOWERCASE_KEY)) {
(*index->mutable_properties())[INVERTED_INDEX_PARSER_LOWERCASE_KEY] =
INVERTED_INDEX_PARSER_TRUE;
if (!_properties.empty()) {
if (!_properties.contains(INVERTED_INDEX_PARSER_LOWERCASE_KEY)) {
(*index->mutable_properties())[INVERTED_INDEX_PARSER_LOWERCASE_KEY] =
INVERTED_INDEX_PARSER_TRUE;
}
}
}

Expand Down
39 changes: 33 additions & 6 deletions be/src/vec/functions/function_date_or_datetime_computation.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <type_traits>
#include <utility>

#include "common/compiler_util.h"
#include "common/exception.h"
#include "common/logging.h"
#include "common/status.h"
#include "fmt/format.h"
Expand Down Expand Up @@ -413,7 +415,11 @@ struct DateTimeOp {
// otherwise it will be implicitly converted to bool, causing the rvalue to fail to match the lvalue.
// the same goes for the following.
vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, vec_from0[i], vec_from1[i]);
}
}
}

Expand All @@ -438,7 +444,11 @@ struct DateTimeOp {
bool invalid = true;
for (size_t i = 0; i < size; ++i) {
vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, vec_from0[i], vec_from1[i]);
}
}
}

Expand All @@ -462,7 +472,11 @@ struct DateTimeOp {
bool invalid = true;
for (size_t i = 0; i < size; ++i) {
vec_to[i] = Transform::execute(vec_from[i], delta, invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, vec_from[i], delta);
}
}
}

Expand All @@ -486,7 +500,11 @@ struct DateTimeOp {

for (size_t i = 0; i < size; ++i) {
vec_to[i] = Transform::execute(vec_from[i], delta, invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, vec_from[i], delta);
}
}
}

Expand All @@ -510,7 +528,11 @@ struct DateTimeOp {

for (size_t i = 0; i < size; ++i) {
vec_to[i] = Transform::execute(from, delta.get_int(i), invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, from, delta.get_int(i));
}
}
}

Expand All @@ -524,6 +546,7 @@ struct DateTimeOp {
vec_to[i] = Transform::execute(from, delta[i], reinterpret_cast<bool&>(null_map[i]));
}
}

static void constant_vector(const FromType1& from, PaddedPODArray<ToType>& vec_to,
const PaddedPODArray<FromType2>& delta) {
size_t size = delta.size();
Expand All @@ -532,7 +555,11 @@ struct DateTimeOp {

for (size_t i = 0; i < size; ++i) {
vec_to[i] = Transform::execute(from, delta[i], invalid);
DCHECK(!invalid);

if (UNLIKELY(invalid)) {
throw Exception(ErrorCode::OUT_OF_BOUND, "Operation {} {} {} out of range",
Transform::name, from, delta[i]);
}
}
}
};
Expand Down
Loading

0 comments on commit 5caada9

Please sign in to comment.