diff --git a/docs/en/docs/admin-manual/config/fe-config.md b/docs/en/docs/admin-manual/config/fe-config.md index a5ba02abe2a6bc..7bb97aa4a16576 100644 --- a/docs/en/docs/admin-manual/config/fe-config.md +++ b/docs/en/docs/admin-manual/config/fe-config.md @@ -2667,3 +2667,17 @@ MasterOnly:false Only take effect when `prefer_compute_node_for_external_table` is true. If the compute node number is less than this value, query on external table will try to get some mix node to assign, to let the total number of node reach this value. If the compute node number is larger than this value, query on external table will assign to compute node only. +#### `infodb_support_ext_catalog` + + + +Default: false + +IsMutable: true + +MasterOnly: false + +If false, when select from tables in information_schema database, +the result will not contain the information of the table in external catalog. +This is to avoid query time when external catalog is not reachable. + diff --git a/docs/zh-CN/docs/admin-manual/config/fe-config.md b/docs/zh-CN/docs/admin-manual/config/fe-config.md index d818ea09cbd4d4..0f36b86b57ffbc 100644 --- a/docs/zh-CN/docs/admin-manual/config/fe-config.md +++ b/docs/zh-CN/docs/admin-manual/config/fe-config.md @@ -2665,3 +2665,17 @@ show data (其他用法:HELP SHOW DATA) 仅在 `prefer_compute_node_for_external_table` 为 true 时生效。如果计算节点数小于此值,则对外部表的查询将尝试使用一些混合节点,让节点总数达到这个值。 如果计算节点数大于这个值,外部表的查询将只分配给计算节点。 + +#### `infodb_support_ext_catalog` + + + +默认值:false + +是否可以动态配置:true + +是否为 Master FE 节点独有的配置项:false + +当设置为 false 时,查询 `information_schema` 中的表时,将不再返回 external catalog 中的表的信息。 + +这个参数主要用于避免因 external catalog 无法访问、信息过多等原因导致的查询 `information_schema` 超时的问题。 diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 9a9ca8ce3e81fc..f38fc90920eccc 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2104,5 +2104,14 @@ public class Config extends ConfigBase { */ @ConfField public static long lock_reporting_threshold_ms = 500L; + + /** + * If false, when select from tables in information_schema database, + * the result will not contain the information of the table in external catalog. + * This is to avoid query time when external catalog is not reachable. + * TODO: this is a temp solution, we should support external catalog in the future. + */ + @ConfField(mutable = true) + public static boolean infodb_support_ext_catalog = false; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/SchemaScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/SchemaScanNode.java index 91156775555560..91867f84c69a5c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/SchemaScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SchemaScanNode.java @@ -23,6 +23,7 @@ import org.apache.doris.common.Config; import org.apache.doris.common.UserException; import org.apache.doris.common.util.Util; +import org.apache.doris.datasource.InternalCatalog; import org.apache.doris.qe.ConnectContext; import org.apache.doris.service.FrontendOptions; import org.apache.doris.statistics.StatisticalType; @@ -103,6 +104,8 @@ protected void toThrift(TPlanNode msg) { } if (schemaCatalog != null) { msg.schema_scan_node.setCatalog(schemaCatalog); + } else if (!Config.infodb_support_ext_catalog) { + msg.schema_scan_node.setCatalog(InternalCatalog.INTERNAL_CATALOG_NAME); } msg.schema_scan_node.show_hidden_cloumns = Util.showHiddenColumns();