[fix](stats) Ignore complex type by default when collect column statistics (#21965)

By default, if it contains any complex type in Analyze stmt submitted by user and error would be thrown before this PR.
This commit is contained in:
AKIRA
2023-07-25 18:26:49 +08:00
committed by GitHub
parent 3b6702a1e3
commit 30965eed21
3 changed files with 5 additions and 5 deletions

View File

@ -188,7 +188,7 @@ public class AnalyzeTblStmt extends AnalyzeStmt {
}
}
if (containsUnsupportedTytpe) {
if (ConnectContext.get().getSessionVariable().ignoreColumnWithComplexType) {
if (!ConnectContext.get().getSessionVariable().enableAnalyzeComplexTypeColumn) {
columnNames = columnNames.stream()
.filter(c -> !ColumnStatistic.UNSUPPORTED_TYPE.contains(
table.getColumn(c).getType()))

View File

@ -351,7 +351,7 @@ public class SessionVariable implements Serializable, Writable {
public static final String ENABLE_SCAN_RUN_SERIAL = "enable_scan_node_run_serial";
public static final String IGNORE_COMPLEX_TYPE_COLUMN = "ignore_column_with_complex_type";
public static final String ENABLE_ANALYZE_COMPLEX_TYPE_COLUMN = "enable_analyze_complex_type_column";
public static final String EXTERNAL_TABLE_ANALYZE_PART_NUM = "external_table_analyze_part_num";
@ -1036,8 +1036,8 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = ENABLE_CTE_MATERIALIZE)
public boolean enableCTEMaterialize = true;
@VariableMgr.VarAttr(name = IGNORE_COMPLEX_TYPE_COLUMN)
public boolean ignoreColumnWithComplexType = false;
@VariableMgr.VarAttr(name = ENABLE_ANALYZE_COMPLEX_TYPE_COLUMN)
public boolean enableAnalyzeComplexTypeColumn = false;
@VariableMgr.VarAttr(name = ENABLE_STRONG_CONSISTENCY, description = {"用以开启强一致读。Doris 默认支持同一个会话内的"
+ "强一致性,即同一个会话内对数据的变更操作是实时可见的。如需要会话间的强一致读,则需将此变量设置为true。",

View File

@ -156,7 +156,7 @@ public class ColumnStatistic {
}
}
} catch (Throwable t) {
LOG.warn("Failed to deserialize column stats", t);
LOG.debug("Failed to deserialize column stats", t);
return ColumnStatistic.UNKNOWN;
}
Preconditions.checkState(columnStatistic != null, "Column stats is null");