Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion be/src/exec/olap_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ Status OlapScanner::_init_tablet_reader_params(
->rowset_meta()
->is_segments_overlapping());

_tablet_reader_params.direct_mode = single_version || _aggregation;
if (_runtime_state->agg_as_duplicate()) {
_tablet_reader_params.direct_mode = true;
} else {
_tablet_reader_params.direct_mode = single_version || _aggregation;
}

RETURN_IF_ERROR(_init_return_columns(!_tablet_reader_params.direct_mode));

Expand Down
4 changes: 4 additions & 0 deletions be/src/runtime/runtime_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ class RuntimeState {
return _query_options.enable_enable_exchange_node_parallel_merge;
}

bool agg_as_duplicate() const {
return _query_options.agg_as_duplicate;
}

// the following getters are only valid after Prepare()
InitialReservations* initial_reservations() const { return _initial_reservations; }

Expand Down
5 changes: 4 additions & 1 deletion docs/en/administrator-guide/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,7 @@ Translated with www.DeepL.com/Translator (free version)
SM4_128_CFB128,
SM4_128_OFB,
SM4_128_CTR,
```
```

* `agg_as_duplicate`
For debugging purpose. In case of problems of reading data of Aggregate Key model and Unique Key model, setting value to `true` will read data as Duplicate Key model.
2 changes: 2 additions & 0 deletions docs/zh-CN/administrator-guide/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,5 @@ SELECT /*+ SET_VAR(query_timeout = 1, enable_partition_cache=true) */ sleep(3);

用于控制是否进行谓词推导。取值有两种:true 和 false。默认情况下关闭,系统不在进行谓词推导,采用原始的谓词进行相关操作。设置为 true 后,进行谓词扩展。

* `agg_as_duplicate`
用于调试目的。当发现读取Aggregate Key模型或者Unique Key模型的数据结果有问题的时候,把此变量的值设置为`true`,将会把Aggregate Key模型或者Unique Key模型的数据当成Duplicate Key模型读取。
10 changes: 10 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public class SessionVariable implements Serializable, Writable {

static final String SESSION_CONTEXT = "session_context";

static final String AGG_AS_DUPLICATE = "agg_as_duplicate";

// session origin value
public Map<Field, String> sessionOriginValue = new HashMap<Field, String>();
// check stmt is or not [select /*+ SET_VAR(...)*/ ...]
Expand Down Expand Up @@ -463,6 +465,12 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = SESSION_CONTEXT, needForward = true)
public String sessionContext = "";

/**
* For debugg purpose, dont' merge unique key and agg key when reading data.
*/
@VariableMgr.VarAttr(name = AGG_AS_DUPLICATE)
private boolean aggAsDuplicate = false;

public String getBlockEncryptionMode() {
return blockEncryptionMode;
}
Expand Down Expand Up @@ -970,6 +978,8 @@ public TQueryOptions toThrift() {
tResult.setResourceLimit(resourceLimit);
}

tResult.setAggAsDuplicate(aggAsDuplicate);

return tResult;
}

Expand Down
3 changes: 3 additions & 0 deletions gensrc/thrift/PaloInternalService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ struct TQueryOptions {

// trim tailing spaces while querying external table and stream load
44: optional bool trim_tailing_spaces_for_external_table_query = false

// For debug purpose, dont' merge unique key and agg key when reading data.
45: optional bool agg_as_duplicate = false
}


Expand Down