Skip to content
Merged
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
7 changes: 6 additions & 1 deletion be/src/exec/olap_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ Status OlapScanner::_init_tablet_reader_params(
->rowset_meta()
->is_segments_overlapping());

_tablet_reader_params.direct_mode = single_version || _aggregation;
if (_runtime_state->skip_storage_engine_merge()) {
_tablet_reader_params.direct_mode = true;
_aggregation = 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: 2 additions & 2 deletions be/src/olap/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ OLAPStatus TabletReader::_init_delete_condition(const ReaderParams& read_params)
if (read_params.reader_type == READER_CUMULATIVE_COMPACTION) {
return OLAP_SUCCESS;
}
OLAPStatus ret;
{
OLAPStatus ret = OLAP_SUCCESS;
if (read_params.runtime_state && !read_params.runtime_state->skip_delete_predicate()) {
ReadLock rdlock(_tablet->get_header_lock());
ret = _delete_handler.init(_tablet->tablet_schema(), _tablet->delete_predicates(),
read_params.version.second, this);
Expand Down
9 changes: 9 additions & 0 deletions be/src/runtime/runtime_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ class RuntimeState {
return _query_options.enable_enable_exchange_node_parallel_merge;
}

bool skip_storage_engine_merge() const {
return _query_options.__isset.skip_storage_engine_merge &&
_query_options.skip_storage_engine_merge;
}

bool skip_delete_predicate() const {
return _query_options.__isset.skip_delete_predicate && _query_options.skip_delete_predicate;
}

const std::vector<TTabletCommitInfo>& tablet_commit_infos() const {
return _tablet_commit_infos;
}
Expand Down
8 changes: 7 additions & 1 deletion docs/en/administrator-guide/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,10 @@ Translated with www.DeepL.com/Translator (free version)
SM4_128_CFB128,
SM4_128_OFB,
SM4_128_CTR,
```
```

* `skip_storage_engine_merge`
For debugging purpose. In vectorized execution engine, 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.

* `skip_delete_predicate`
For debugging purpose. In vectorized execution engine, in case of problems of reading data, setting value to `true` will also read deleted data.
5 changes: 5 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,8 @@ SELECT /*+ SET_VAR(query_timeout = 1, enable_partition_cache=true) */ sleep(3);

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

* `skip_storage_engine_merge`
用于调试目的。在向量化执行引擎中,当发现读取Aggregate Key模型或者Unique Key模型的数据结果有问题的时候,把此变量的值设置为`true`,将会把Aggregate Key模型或者Unique Key模型的数据当成Duplicate Key模型读取。

* `skip_delete_predicate`
用于调试目的。在向量化执行引擎中,当发现读取表的数据结果有误的时候,把此变量的值设置为`true`,将会把被删除的数据当成正常数据读取。
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ public static InputStream getInputStreamFromUrl(String urlStr, String encodedAut
}

public static boolean showHiddenColumns() {
return ConnectContext.get() != null && ConnectContext.get().getSessionVariable().showHiddenColumns();
return ConnectContext.get() != null && (
ConnectContext.get().getSessionVariable().showHiddenColumns()
|| ConnectContext.get().getSessionVariable().skipStorageEngineMerge());
}

public static String escapeSingleRegex(String s) {
Expand Down
24 changes: 24 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 @@ -191,6 +191,10 @@ public class SessionVariable implements Serializable, Writable {

public static final String NUM_FREE_BLOCK_IN_SCAN = "num_free_block_in_scan";

public static final String SKIP_STORAGE_ENGINE_MERGE = "skip_storage_engine_merge";

public static final String SKIP_DELETE_PREDICATE = "skip_delete_predicate";

// session origin value
public Map<Field, String> sessionOriginValue = new HashMap<Field, String>();
// check stmt is or not [select /*+ SET_VAR(...)*/ ...]
Expand Down Expand Up @@ -468,6 +472,18 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = NUM_FREE_BLOCK_IN_SCAN)
public int numFreeBlockInScan = 12;

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

/**
* For debugg purpose, skip delte predicate when reading data.
*/
@VariableMgr.VarAttr(name = SKIP_DELETE_PREDICATE)
public boolean skipDeletePredicate = false;


public String getBlockEncryptionMode() {
return blockEncryptionMode;
Expand Down Expand Up @@ -768,6 +784,10 @@ public void setShowHiddenColumns(boolean showHiddenColumns) {
this.showHiddenColumns = showHiddenColumns;
}

public boolean skipStorageEngineMerge() {
return skipStorageEngineMerge;
}

public boolean isAllowPartitionColumnNullable() {
return allowPartitionColumnNullable;
}
Expand Down Expand Up @@ -977,6 +997,10 @@ public TQueryOptions toThrift() {
tResult.setResourceLimit(resourceLimit);
}

tResult.setSkipStorageEngineMerge(skipStorageEngineMerge);

tResult.setSkipDeletePredicate(skipDeletePredicate);

return tResult;
}

Expand Down
6 changes: 6 additions & 0 deletions gensrc/thrift/PaloInternalService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ struct TQueryOptions {
44: optional bool trim_tailing_spaces_for_external_table_query = false

47: optional i32 num_free_block_in_scan

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

// For debug purpose, skip delete predicates when reading data
49: optional bool skip_delete_predicate = false
}

// A scan range plus the parameters needed to execute that scan.
Expand Down