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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.nereids.trees.plans.logical;

import org.apache.doris.analysis.StmtType;
import org.apache.doris.nereids.memo.GroupExpression;
import org.apache.doris.nereids.properties.LogicalProperties;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
Expand Down Expand Up @@ -82,4 +83,9 @@ public String toString() {
return Utils.toSqlString("LogicalResultSink[" + id.asInt() + "]",
"outputExprs", outputExprs);
}

@Override
public StmtType stmtType() {
return StmtType.SELECT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.doris.nereids.trees.plans.logical;

import org.apache.doris.analysis.Expr;
import org.apache.doris.analysis.StmtType;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.mysql.FieldInfo;
import org.apache.doris.nereids.memo.GroupExpression;
Expand Down Expand Up @@ -142,4 +143,9 @@ public List<Slot> computeOutput() {
public String getChildrenTreeString() {
return planBody;
}

@Override
public StmtType stmtType() {
return StmtType.SELECT;
}
}
40 changes: 27 additions & 13 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 @@ -699,11 +699,18 @@ public class SessionVariable implements Serializable, Writable {

public static final String EXCHANGE_MULTI_BLOCKS_BYTE_SIZE = "exchange_multi_blocks_byte_size";

public static final String SKIP_CHECKING_ACID_VERSION_FILE = "skip_checking_acid_version_file";

// NOTE: if you want to add some debug variables, please disable sql cache in `CacheAnalyzer.commonCacheCondition`,
// and set affectQueryResult=true
public static final List<String> DEBUG_VARIABLES = ImmutableList.of(
DRY_RUN_QUERY,
SKIP_DELETE_PREDICATE,
SKIP_DELETE_BITMAP,
SKIP_DELETE_SIGN,
SKIP_STORAGE_ENGINE_MERGE,
SKIP_MISSING_VERSION,
SKIP_BAD_TABLET,
SHOW_HIDDEN_COLUMNS
);

Expand Down Expand Up @@ -747,7 +754,6 @@ public class SessionVariable implements Serializable, Writable {

public static final String ENABLE_COOLDOWN_REPLICA_AFFINITY =
"enable_cooldown_replica_affinity";
public static final String SKIP_CHECKING_ACID_VERSION_FILE = "skip_checking_acid_version_file";

public static final String READ_HIVE_JSON_IN_ONE_COLUMN = "read_hive_json_in_one_column";

Expand Down Expand Up @@ -1278,7 +1284,12 @@ public enum IgnoreSplitType {
public int maxScanKeyNum = 48;
@VariableMgr.VarAttr(name = MAX_PUSHDOWN_CONDITIONS_PER_COLUMN)
public int maxPushdownConditionsPerColumn = 1024;
@VariableMgr.VarAttr(name = SHOW_HIDDEN_COLUMNS, flag = VariableMgr.SESSION_ONLY, needForward = true)
@VariableMgr.VarAttr(
name = SHOW_HIDDEN_COLUMNS,
flag = VariableMgr.SESSION_ONLY,
needForward = true,
affectQueryResult = true
)
public boolean showHiddenColumns = false;

@VariableMgr.VarAttr(name = ALLOW_PARTITION_COLUMN_NULLABLE, description = {
Expand Down Expand Up @@ -1834,25 +1845,25 @@ public boolean isEnableHboNonStrictMatchingMode() {
/**
* For debug purpose, don't merge unique key and agg key when reading data.
*/
@VariableMgr.VarAttr(name = SKIP_STORAGE_ENGINE_MERGE, needForward = true)
@VariableMgr.VarAttr(name = SKIP_STORAGE_ENGINE_MERGE, needForward = true, affectQueryResult = true)
public boolean skipStorageEngineMerge = false;

/**
* For debug purpose, skip delete predicate when reading data.
*/
@VariableMgr.VarAttr(name = SKIP_DELETE_PREDICATE, needForward = true)
@VariableMgr.VarAttr(name = SKIP_DELETE_PREDICATE, needForward = true, affectQueryResult = true)
public boolean skipDeletePredicate = false;

/**
* For debug purpose, skip delete sign when reading data.
*/
@VariableMgr.VarAttr(name = SKIP_DELETE_SIGN, needForward = true)
@VariableMgr.VarAttr(name = SKIP_DELETE_SIGN, needForward = true, affectQueryResult = true)
public boolean skipDeleteSign = false;

/**
* For debug purpose, skip delete bitmap when reading data.
*/
@VariableMgr.VarAttr(name = SKIP_DELETE_BITMAP, needForward = true)
@VariableMgr.VarAttr(name = SKIP_DELETE_BITMAP, needForward = true, affectQueryResult = true)
public boolean skipDeleteBitmap = false;

// This variable replace the original FE config `recover_with_skip_missing_version`.
Expand All @@ -1865,15 +1876,15 @@ public boolean isEnableHboNonStrictMatchingMode() {
// You should only open it in the emergency scenarios mentioned above, only used for temporary recovery queries.
// This variable conflicts with the use_fix_replica variable, when the use_fix_replica variable is not -1,
// this variable will not work.
@VariableMgr.VarAttr(name = SKIP_MISSING_VERSION)
@VariableMgr.VarAttr(name = SKIP_MISSING_VERSION, affectQueryResult = true)
public boolean skipMissingVersion = false;

// This variable is used to control whether to skip the bad tablet.
// In some scenarios, user has a huge amount of data and only a single replica was specified when creating
// the table, if one of the tablet is damaged, the table will not be able to be select. If the user does not care
// about the integrity of the data, they can use this variable to temporarily skip the bad tablet for querying and
// load the remaining data into a new table.
@VariableMgr.VarAttr(name = SKIP_BAD_TABLET)
@VariableMgr.VarAttr(name = SKIP_BAD_TABLET, affectQueryResult = true)
public boolean skipBadTablet = false;

// This variable is used to avoid FE fallback to the original parser. When we execute SQL in regression tests
Expand Down Expand Up @@ -2870,10 +2881,12 @@ public void setDetailShapePlanNodes(String detailShapePlanNodes) {
})
public boolean enableTextValidateUtf8 = true;

@VariableMgr.VarAttr(name = SKIP_CHECKING_ACID_VERSION_FILE, needForward = true, description = {
"跳过检查 transactional hive 版本文件 '_orc_acid_version.'",
"Skip checking transactional hive version file '_orc_acid_version.'"
})
@VariableMgr.VarAttr(name = SKIP_CHECKING_ACID_VERSION_FILE, needForward = true, affectQueryResult = true,
description = {
"跳过检查 transactional hive 版本文件 '_orc_acid_version.'",
"Skip checking transactional hive version file '_orc_acid_version.'"
}
)
public boolean skipCheckingAcidVersionFile = false;

@VariableMgr.VarAttr(name = ENABLE_SQL_CONVERTOR_FEATURES, needForward = true,
Expand Down Expand Up @@ -3201,7 +3214,8 @@ public String printFuzzyVariables() {
private Set<Class<? extends Event>> parsedNereidsEventMode = EventSwitchParser.parse(Lists.newArrayList("all"));

public boolean isInDebugMode() {
return showHiddenColumns || skipDeleteBitmap || skipDeletePredicate || skipDeleteSign || skipStorageEngineMerge;
return showHiddenColumns || skipDeleteBitmap || skipDeletePredicate || skipDeleteSign || skipStorageEngineMerge
|| skipMissingVersion || skipBadTablet;
}

public String printDebugModeVariables() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,14 @@ public static boolean canUseSqlCache(SessionVariable sessionVariable) {

public static boolean commonCacheCondition(SessionVariable sessionVariable) {
return sessionVariable.getSqlSelectLimit() < 0 && sessionVariable.getDefaultOrderByLimit() < 0
&& !sessionVariable.dryRunQuery;
&& !sessionVariable.dryRunQuery
&& !sessionVariable.skipDeleteBitmap
&& !sessionVariable.skipDeleteSign
&& !sessionVariable.skipDeletePredicate
&& !sessionVariable.skipStorageEngineMerge
&& !sessionVariable.skipMissingVersion
&& !sessionVariable.skipBadTablet
&& !sessionVariable.showHiddenColumns;
}

public void checkCacheModeForNereids(long now) {
Expand Down