-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathrowset_reader_context.h
More file actions
114 lines (100 loc) · 4.53 KB
/
rowset_reader_context.h
File metadata and controls
114 lines (100 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef DORIS_BE_SRC_OLAP_ROWSET_ROWSET_READER_CONTEXT_H
#define DORIS_BE_SRC_OLAP_ROWSET_ROWSET_READER_CONTEXT_H
#include <vector>
#include "exprs/score_runtime.h"
#include "exprs/vexpr.h"
#include "exprs/vexpr_context.h"
#include "io/io_common.h"
#include "runtime/runtime_state.h"
#include "storage/index/ann/ann_topn_runtime.h"
#include "storage/olap_common.h"
#include "storage/predicate/column_predicate.h"
#include "storage/rowid_conversion.h"
namespace doris {
class RowCursor;
class DeleteBitmap;
class DeleteHandler;
class TabletSchema;
struct RowsetReaderContext {
ReaderType reader_type = ReaderType::READER_QUERY;
Version version {-1, -1};
TabletSchemaSPtr tablet_schema = nullptr;
std::vector<int> topn_filter_source_node_ids;
int topn_filter_target_node_id = -1;
// whether rowset should return ordered rows.
bool need_ordered_result = true;
// used for special optimization for query : ORDER BY key DESC LIMIT n
bool read_orderby_key_reverse = false;
// columns for orderby keys
std::vector<uint32_t>* read_orderby_key_columns = nullptr;
// limit of rows for read_orderby_key
size_t read_orderby_key_limit = 0;
// filter_block arguments
VExprContextSPtrs filter_block_conjuncts;
// projection columns: the set of columns rowset reader should return
const std::vector<uint32_t>* return_columns = nullptr;
TPushAggOp::type push_down_agg_type_opt = TPushAggOp::NONE;
// column name -> column predicate
// adding column_name for predicate to make use of column selectivity
const std::vector<std::shared_ptr<ColumnPredicate>>* predicates = nullptr;
// value column predicate in UNIQUE table
const std::vector<std::shared_ptr<ColumnPredicate>>* value_predicates = nullptr;
const std::vector<RowCursor>* lower_bound_keys = nullptr;
const std::vector<bool>* is_lower_keys_included = nullptr;
const std::vector<RowCursor>* upper_bound_keys = nullptr;
const std::vector<bool>* is_upper_keys_included = nullptr;
const DeleteHandler* delete_handler = nullptr;
OlapReaderStatistics* stats = nullptr;
RuntimeState* runtime_state = nullptr;
std::vector<VExprSPtr> remaining_conjunct_roots;
VExprContextSPtrs common_expr_ctxs_push_down;
bool use_page_cache = false;
int sequence_id_idx = -1;
int batch_size = 1024;
bool is_unique = false;
//record row num merged in generic iterator
uint64_t* merged_rows = nullptr;
// for unique key merge on write
bool enable_unique_key_merge_on_write = false;
DeleteBitmapPtr delete_bitmap = nullptr;
bool record_rowids = false;
RowIdConversion* rowid_conversion = nullptr;
bool is_key_column_group = false;
const std::set<int32_t>* output_columns = nullptr;
RowsetId rowset_id;
// slots that cast may be eliminated in storage layer
std::map<std::string, DataTypePtr> target_cast_type_for_variants;
int64_t ttl_seconds = 0;
std::map<ColumnId, VExprContextSPtr> virtual_column_exprs;
std::map<ColumnId, size_t> vir_cid_to_idx_in_block;
std::map<size_t, DataTypePtr> vir_col_idx_to_type;
std::map<int32_t, TColumnAccessPaths> all_access_paths;
std::map<int32_t, TColumnAccessPaths> predicate_access_paths;
std::shared_ptr<ScoreRuntime> score_runtime;
CollectionStatisticsPtr collection_statistics;
std::shared_ptr<segment_v2::AnnTopNRuntime> ann_topn_runtime;
uint64_t condition_cache_digest = 0;
// When true, push down value predicates for MOR tables
bool enable_mor_value_predicate_pushdown = false;
// General limit pushdown for DUP_KEYS and UNIQUE_KEYS with MOW.
// Propagated from ReaderParams.general_read_limit.
int64_t general_read_limit = -1;
};
} // namespace doris
#endif // DORIS_BE_SRC_OLAP_ROWSET_ROWSET_READER_CONTEXT_H