From 4178fcfbfbd09fd36949ec74af6cc30c55064f2c Mon Sep 17 00:00:00 2001 From: megao Date: Tue, 29 Oct 2024 10:20:02 +0800 Subject: [PATCH 1/2] add name ALIAS metric --- src/Storages/System/StorageSystemAsynchronousMetrics.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Storages/System/StorageSystemAsynchronousMetrics.cpp b/src/Storages/System/StorageSystemAsynchronousMetrics.cpp index a54b577d72b..26aa66aa507 100644 --- a/src/Storages/System/StorageSystemAsynchronousMetrics.cpp +++ b/src/Storages/System/StorageSystemAsynchronousMetrics.cpp @@ -9,12 +9,18 @@ namespace DB ColumnsDescription StorageSystemAsynchronousMetrics::getColumnsDescription() { - return ColumnsDescription + auto description = ColumnsDescription { {"metric", std::make_shared(), "Metric name."}, {"value", std::make_shared(), "Metric value."}, {"description", std::make_shared(), "Metric description."}, }; + + description.setAliases({ + {"name", std::make_shared(), "metric"} + }); + + return description; } From 1988310c48728ec965716e77dff4e70f7333c04f Mon Sep 17 00:00:00 2001 From: megao Date: Tue, 5 Nov 2024 16:56:09 +0800 Subject: [PATCH 2/2] fix show create table test issue --- .../0_stateless/02117_show_create_table_system.reference | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index b260e2dce6c..3315ae8849b 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_system.reference @@ -22,7 +22,8 @@ CREATE TABLE system.asynchronous_metrics ( `metric` String, `value` Float64, - `description` String + `description` String, + `name` String ALIAS metric ) ENGINE = SystemAsynchronousMetrics COMMENT 'Contains metrics that are calculated periodically in the background. For example, the amount of RAM in use.'