[improvement](statistics)Disable fetch stats for iceberg table through Iceberg api by default. (#36931) (#36999)

backport https://github.com/apache/doris/pull/36931
This commit is contained in:
Jibing-Li
2024-06-28 16:23:25 +08:00
committed by GitHub
parent 816899df41
commit 65e8bbf0f2
2 changed files with 15 additions and 2 deletions

View File

@ -573,10 +573,14 @@ public class HMSExternalTable extends ExternalTable implements MTMVRelatedTableI
case HIVE:
return getHiveColumnStats(colName);
case ICEBERG:
return StatisticsUtil.getIcebergColumnStats(colName,
if (GlobalVariable.enableFetchIcebergStats) {
return StatisticsUtil.getIcebergColumnStats(colName,
Env.getCurrentEnv().getExtMetaCacheMgr().getIcebergMetadataCache().getIcebergTable(
catalog, dbName, name
catalog, dbName, name
));
} else {
break;
}
default:
LOG.warn("get column stats for dlaType {} is not supported.", dlaType);
}

View File

@ -63,6 +63,9 @@ public final class GlobalVariable {
public static final String DEFAULT_USING_META_CACHE_FOR_EXTERNAL_CATALOG
= "default_using_meta_cache_for_external_catalog";
public static final String ENABLE_FETCH_ICEBERG_STATS = "enable_fetch_iceberg_stats";
@VariableMgr.VarAttr(name = VERSION_COMMENT, flag = VariableMgr.READ_ONLY)
public static String versionComment = "Doris version "
+ Version.DORIS_BUILD_VERSION + "-" + Version.DORIS_BUILD_SHORT_HASH;
@ -155,6 +158,12 @@ public final class GlobalVariable {
"Only for compatibility with MySQL ecosystem, no practical meaning"})
public static boolean super_read_only = true;
@VariableMgr.VarAttr(name = ENABLE_FETCH_ICEBERG_STATS, flag = VariableMgr.GLOBAL,
description = {
"当HMS catalog中的Iceberg表没有统计信息时,是否通过Iceberg Api获取统计信息",
"Enable fetch stats for HMS Iceberg table when it's not analyzed."})
public static boolean enableFetchIcebergStats = false;
// Don't allow creating instance.
private GlobalVariable() {
}