xiaokang commented on code in PR #36163:
URL: https://github.com/apache/doris/pull/36163#discussion_r1641599182
##########
be/src/olap/tablet_schema.cpp:
##########
@@ -1367,7 +1367,13 @@ const TabletIndex*
TabletSchema::get_inverted_index(int32_t col_unique_id,
return nullptr;
}
-const TabletIndex* TabletSchema::get_inverted_index(const TabletColumn& col)
const {
+const TabletIndex* TabletSchema::get_inverted_index(const TabletColumn& col,
+ bool check_valid) const {
+ // With check_valid set to true by default
+ // Some columns from the variant do not support inverted index
+ if (check_valid &&
!segment_v2::InvertedIndexColumnWriter::check_column_valid(col)) {
Review Comment:
The name check_column_valid is not so good. Suggest a new one
check_support_inverted_index.
##########
be/src/olap/tablet_schema.h:
##########
@@ -368,7 +368,10 @@ class TabletSchema {
bool has_inverted_index_with_index_id(int64_t index_id, const std::string&
suffix_path) const;
const TabletIndex* get_inverted_index_with_index_id(int64_t index_id,
const std::string&
suffix_name) const;
- const TabletIndex* get_inverted_index(const TabletColumn& col) const;
+ // check_valid: check if this column supports inverted index
+ // Some columns from the variant do not support index, but they are listed
in TabletIndex.
Review Comment:
Give some examples here
##########
be/src/vec/common/schema_util.cpp:
##########
@@ -389,7 +389,7 @@ void inherit_column_attributes(const TabletColumn& source,
TabletColumn& target,
// add index meta
TabletIndex index_info = *source_index_meta;
index_info.set_escaped_escaped_index_suffix_path(target.path_info_ptr()->get_path());
- const auto* target_index_meta =
target_schema->get_inverted_index(target);
+ const auto* target_index_meta =
target_schema->get_inverted_index(target, false);
Review Comment:
Why not always check it?
--
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]