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 @@ -562,10 +562,11 @@ public Statistics computeOlapScan(OlapScan olapScan) {

StatisticsBuilder builder = new StatisticsBuilder();

// for system table or FeUt, use ColumnStatistic.UNKNOWN
// query for system table or FeUt or analysis, use ColumnStatistic.UNKNOWN

if (StatisticConstants.isSystemTable(olapTable) || !FeConstants.enableInternalSchemaDb
|| ConnectContext.get() == null
|| ConnectContext.get().getState().isInternal()) {
|| ConnectContext.get().getState().isPlanWithUnKnownColumnStats()) {
for (Slot slot : ((Plan) olapScan).getOutput()) {
builder.putColumnStatistics(slot, ColumnStatistic.UNKNOWN);
}
Expand Down
10 changes: 10 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/qe/QueryState.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public enum ErrType {
private boolean isNereids = true;
private boolean isInternal = false;
private ShowResultSet rs = null;
private boolean planWithUnKnownColumnStats = false;

public QueryState() {
}
Expand All @@ -69,6 +70,7 @@ public void reset() {
warningRows = 0;
isNereids = false;
rs = null;
planWithUnKnownColumnStats = false;
}

public MysqlStateType getStateType() {
Expand Down Expand Up @@ -194,4 +196,12 @@ public MysqlPacket toResponsePacket() {
public String toString() {
return String.valueOf(stateType);
}

public boolean isPlanWithUnKnownColumnStats() {
return planWithUnKnownColumnStats;
}

public void setPlanWithUnKnownColumnStats(boolean planWithUnKnownColumnStats) {
this.planWithUnKnownColumnStats = planWithUnKnownColumnStats;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ protected void runQuery(String sql) {
long startTime = System.currentTimeMillis();
String queryId = "";
try (AutoCloseConnectContext a = StatisticsUtil.buildConnectContext(false)) {
a.connectContext.getState().setPlanWithUnKnownColumnStats(true);
stmtExecutor = new StmtExecutor(a.connectContext, sql);
ColStatsData colStatsData = new ColStatsData(stmtExecutor.executeInternalQuery().get(0));
if (!colStatsData.isValid()) {
Expand Down
Loading