Skip to content

Commit c5e3e8b

Browse files
authored
Revert "[chore](scan) Add session veriable query_max_scan_bytes apache#14" (apache#21)
This reverts commit baa51ca.
1 parent 59a46a7 commit c5e3e8b

4 files changed

Lines changed: 0 additions & 33 deletions

File tree

‎be/src/runtime/query_context.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,6 @@ class QueryContext {
173173

174174
RuntimeFilterMgr* runtime_filter_mgr() { return _runtime_filter_mgr.get(); }
175175

176-
int64_t query_max_scan_bytes() const {
177-
return _query_options.__isset.query_max_scan_bytes ? _query_options.query_max_scan_bytes
178-
: -1;
179-
}
180-
181-
Status add_scan_bytes(uint64_t bytes) {
182-
_scan_bytes.fetch_add(bytes, std::memory_order_relaxed);
183-
if (query_max_scan_bytes() != -1 &&
184-
_scan_bytes.load(std::memory_order_relaxed) > query_max_scan_bytes()) {
185-
return Status::Cancelled(
186-
"Scan bytes: {} exceed session veriable query_max_scan_bytes: {}",
187-
_scan_bytes.load(std::memory_order_relaxed), query_max_scan_bytes());
188-
}
189-
return Status::OK();
190-
}
191-
192176
public:
193177
TUniqueId query_id;
194178
DescriptorTbl* desc_tbl;
@@ -242,7 +226,6 @@ class QueryContext {
242226
taskgroup::TaskGroupPtr _task_group;
243227
std::unique_ptr<RuntimeFilterMgr> _runtime_filter_mgr;
244228
const TQueryOptions _query_options;
245-
std::atomic<uint64_t> _scan_bytes {0};
246229
};
247230

248231
} // namespace doris

‎be/src/vec/exec/scan/vscanner.cpp‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ Status VScanner::get_block(RuntimeState* state, Block* block, bool* eof) {
7979
break;
8080
}
8181
_num_rows_read += block->rows();
82-
if (_num_rows_read % 10 == 0) {
83-
RETURN_IF_ERROR(
84-
state->get_query_ctx()->add_scan_bytes(block->allocated_bytes()));
85-
}
8682
}
8783

8884
// 2. Filter the output block finally.

‎fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ public class SessionVariable implements Serializable, Writable {
407407
SHOW_HIDDEN_COLUMNS
408408
);
409409

410-
public static final String QUERY_MAX_SCAN_BYTES = "query_max_scan_bytes";
411410
// session origin value
412411
public Map<Field, String> sessionOriginValue = new HashMap<Field, String>();
413412
// check stmt is or not [select /*+ SET_VAR(...)*/ ...]
@@ -1137,14 +1136,6 @@ public void setMaxJoinNumberOfReorder(int maxJoinNumberOfReorder) {
11371136
@VariableMgr.VarAttr(name = ENABLE_UNIQUE_KEY_PARTIAL_UPDATE, needForward = true)
11381137
public boolean enableUniqueKeyPartialUpdate = false;
11391138

1140-
@VariableMgr.VarAttr(name = QUERY_MAX_SCAN_BYTES, needForward = true,
1141-
description = {"Query 在单个 BE 最大扫描的数据量, 单位字节",
1142-
"Query largest scan bytes in single BE, Unit bytes"})
1143-
private long queryMaxScanBytes = -1;
1144-
1145-
@VariableMgr.VarAttr(name = "in_to_minmax_parition_rewrite_threshold", needForward = true)
1146-
public double inToMinmaxParitionRewriteThreshold = 0.2;
1147-
11481139
// If this fe is in fuzzy mode, then will use initFuzzyModeVariables to generate some variables,
11491140
// not the default value set in the code.
11501141
public void initFuzzyModeVariables() {
@@ -2247,7 +2238,6 @@ public TQueryOptions toThrift() {
22472238
tResult.setTruncateCharOrVarcharColumns(truncateCharOrVarcharColumns);
22482239

22492240
tResult.setInvertedIndexConjunctionOptThreshold(invertedIndexConjunctionOptThreshold);
2250-
tResult.setQueryMaxScanBytes(queryMaxScanBytes);
22512241

22522242
return tResult;
22532243
}
@@ -2436,7 +2426,6 @@ public TQueryOptions getQueryOptionVariables() {
24362426
queryOptions.setScanQueueMemLimit(Math.min(maxScanQueueMemByte, maxExecMemByte / 20));
24372427
queryOptions.setQueryTimeout(queryTimeoutS);
24382428
queryOptions.setInsertTimeout(insertTimeoutS);
2439-
queryOptions.setQueryMaxScanBytes(queryMaxScanBytes);
24402429
return queryOptions;
24412430
}
24422431

‎gensrc/thrift/PaloInternalService.thrift‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ struct TQueryOptions {
246246
// use is_report_success any more
247247
84: optional bool enable_profile = false;
248248
85: optional bool enable_page_cache = false;
249-
86: optional i64 query_max_scan_bytes = -1;
250249
}
251250

252251

0 commit comments

Comments
 (0)