Skip to content

Commit

Permalink
feat: adds metric engine to information_schema engines table (Greptim…
Browse files Browse the repository at this point in the history
…eTeam#3599)

* feat: adds metric engine to information_schema engines table

* fix: support value for metric engine
  • Loading branch information
killme2008 authored Mar 28, 2024
1 parent 92a8e86 commit 5d7ce08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
15 changes: 9 additions & 6 deletions src/catalog/src/information_schema/memory_table/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@

use std::sync::Arc;

use common_catalog::consts::MITO_ENGINE;
use common_catalog::consts::{METRIC_ENGINE, MITO_ENGINE};
use datatypes::prelude::{ConcreteDataType, VectorRef};
use datatypes::schema::{ColumnSchema, Schema, SchemaRef};
use datatypes::vectors::{Int64Vector, StringVector};

use crate::information_schema::table_names::*;

const NO_VALUE: &str = "NO";

/// Find the schema and columns by the table_name, only valid for memory tables.
/// Safety: the user MUST ensure the table schema exists, panic otherwise.
pub fn get_schema_columns(table_name: &str) -> (SchemaRef, Vec<VectorRef>) {
Expand Down Expand Up @@ -59,14 +61,15 @@ pub fn get_schema_columns(table_name: &str) -> (SchemaRef, Vec<VectorRef>) {
"SAVEPOINTS",
]),
vec![
Arc::new(StringVector::from(vec![MITO_ENGINE])),
Arc::new(StringVector::from(vec!["DEFAULT"])),
Arc::new(StringVector::from(vec![MITO_ENGINE, METRIC_ENGINE])),
Arc::new(StringVector::from(vec!["DEFAULT", "YES"])),
Arc::new(StringVector::from(vec![
"Storage engine for time-series data",
"Storage engine for observability scenarios, which is adept at handling a large number of small tables, making it particularly suitable for cloud-native monitoring",
])),
Arc::new(StringVector::from(vec!["NO"])),
Arc::new(StringVector::from(vec!["NO"])),
Arc::new(StringVector::from(vec!["NO"])),
Arc::new(StringVector::from(vec![NO_VALUE, NO_VALUE])),
Arc::new(StringVector::from(vec![NO_VALUE, NO_VALUE])),
Arc::new(StringVector::from(vec![NO_VALUE, NO_VALUE])),
],
),

Expand Down
11 changes: 6 additions & 5 deletions tests/cases/standalone/common/system/information_schema.result
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,12 @@ select * from schemata where catalog_name = 'greptime' and schema_name != 'publi
-- test engines
select * from engines;

+--------+---------+-------------------------------------+--------------+----+------------+
| engine | support | comment | transactions | xa | savepoints |
+--------+---------+-------------------------------------+--------------+----+------------+
| mito | DEFAULT | Storage engine for time-series data | NO | NO | NO |
+--------+---------+-------------------------------------+--------------+----+------------+
+--------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+----+------------+
| engine | support | comment | transactions | xa | savepoints |
+--------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+----+------------+
| mito | DEFAULT | Storage engine for time-series data | NO | NO | NO |
| metric | YES | Storage engine for observability scenarios, which is adept at handling a large number of small tables, making it particularly suitable for cloud-native monitoring | NO | NO | NO |
+--------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+----+------------+

desc table build_info;

Expand Down

0 comments on commit 5d7ce08

Please sign in to comment.