HappenLee commented on code in PR #64242:
URL: https://github.com/apache/doris/pull/64242#discussion_r3378211855
##########
be/src/exec/rowid_fetcher.cpp:
##########
@@ -318,6 +332,55 @@ struct IteratorItem {
StorageReadOptions storage_read_options;
};
+static void set_slot_access_paths(const SlotDescriptor& slot, const
TabletSchema& schema,
+ StorageReadOptions& storage_read_options) {
+ int32_t unique_id = slot.col_unique_id();
+ const int field_index =
+ unique_id >= 0 ? schema.field_index(unique_id) :
schema.field_index(slot.col_name());
+ if (field_index >= 0) {
+ const auto& column = schema.column(field_index);
+ unique_id = column.unique_id() >= 0 ? column.unique_id() :
column.parent_unique_id();
+ }
+ if (unique_id < 0) {
+ return;
+ }
+
+ if (!slot.all_access_paths().empty()) {
+ storage_read_options.all_access_paths[unique_id] =
slot.all_access_paths();
+ } else {
+ storage_read_options.all_access_paths.erase(unique_id);
+ }
+
+ if (!slot.predicate_access_paths().empty()) {
+ storage_read_options.predicate_access_paths[unique_id] =
slot.predicate_access_paths();
+ } else {
+ storage_read_options.predicate_access_paths.erase(unique_id);
+ }
+}
+
+static bool has_nested_access_paths(const SlotDescriptor& slot) {
+ return !slot.all_access_paths().empty() ||
!slot.predicate_access_paths().empty();
+}
+
+static bool has_nested_access_paths(const std::vector<SlotDescriptor>& slots) {
+ return std::ranges::any_of(
+ slots, [](const SlotDescriptor& slot) { return
has_nested_access_paths(slot); });
+}
+
+static bool has_complex_type(const SlotDescriptor& slot) {
+ return is_complex_type(slot.type()->get_primitive_type());
+}
+
+static bool has_complex_type(const std::vector<SlotDescriptor>& slots) {
+ return std::ranges::any_of(slots,
+ [](const SlotDescriptor& slot) { return
has_complex_type(slot); });
+}
+
+static ReaderType rowid_fetch_reader_type(const SlotDescriptor& slot) {
+ return has_nested_access_paths(slot) || has_complex_type(slot) ?
ReaderType::READER_ALTER_TABLE
Review Comment:
为什么这里要用ReaderType::READER_ALTER_TABLE这种方式呢?
--
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]