From 65b5b3d673da99b4f162f090fc883a053f7a0d11 Mon Sep 17 00:00:00 2001 From: everpcpc Date: Wed, 13 Nov 2024 10:47:37 +0800 Subject: [PATCH 1/5] chore(ci): test with different license (#16815) * chore(ci): test with different license * z * z * z * z --- .github/actions/build_linux/action.yml | 2 +- .github/actions/setup_license/action.yml | 12 ++-- .github/workflows/cloud.yml | 2 + .github/workflows/dev.yml | 1 + .github/workflows/main.yml | 1 + .github/workflows/merge_group.yml | 1 + .github/workflows/release.yml | 3 + .github/workflows/reuse.linux.hive.yml | 10 +-- .github/workflows/reuse.linux.yml | 82 ++++++++++++++---------- .github/workflows/reuse.sqllogic.yml | 7 ++ src/common/building/src/lib.rs | 10 +-- 11 files changed, 84 insertions(+), 47 deletions(-) diff --git a/.github/actions/build_linux/action.yml b/.github/actions/build_linux/action.yml index b7ec2a862e7c..5b032f29b704 100644 --- a/.github/actions/build_linux/action.yml +++ b/.github/actions/build_linux/action.yml @@ -30,7 +30,7 @@ runs: uses: ./.github/actions/setup_build_tool with: target: ${{ inputs.target }} - bypass_env_vars: RUSTFLAGS,RUST_LOG + bypass_env_vars: RUSTFLAGS,RUST_LOG,DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY - name: Cross setup if: startsWith(inputs.target, 'aarch64-') diff --git a/.github/actions/setup_license/action.yml b/.github/actions/setup_license/action.yml index 6ce6167fc6c4..3e72b31f4b62 100644 --- a/.github/actions/setup_license/action.yml +++ b/.github/actions/setup_license/action.yml @@ -5,6 +5,10 @@ inputs: description: "Self-hosted runner provider, aws or gcp" required: true default: "aws" + type: + description: "License type, enterprise or trial" + required: true + default: "trial" runs: using: "composite" @@ -13,15 +17,15 @@ runs: if: inputs.runner_provider == 'aws' shell: bash run: | - aws s3 cp s3://databend-ci/misc/license.key license.key - aws s3 cp s3://databend-ci/misc/license.json license.json + aws s3 cp s3://databend-ci/misc/license-${{ inputs.type }}.key license.key + aws s3 cp s3://databend-ci/misc/license-${{ inputs.type }}.json license.json - name: Get License from GCS if: inputs.runner_provider == 'gcp' shell: bash run: | - gcloud storage cp gs://databend-ci/misc/license.key license.key - gcloud storage cp gs://databend-ci/misc/license.json license.json + gcloud storage cp gs://databend-ci/misc/license-${{ inputs.type }}.key license.key + gcloud storage cp gs://databend-ci/misc/license-${{ inputs.type }}.json license.json - name: Output License shell: bash diff --git a/.github/workflows/cloud.yml b/.github/workflows/cloud.yml index 6ae8f8364bd6..6bb7c37488be 100644 --- a/.github/workflows/cloud.yml +++ b/.github/workflows/cloud.yml @@ -59,6 +59,8 @@ jobs: - name: Build Release uses: ./.github/actions/build_linux timeout-minutes: 60 + env: + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ needs.info.outputs.sha }} target: ${{ matrix.arch }}-unknown-linux-gnu diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 948829c94004..bc8c519d0495 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -52,6 +52,7 @@ jobs: with: build_profile: release runner_provider: aws + license_type: trial linux_hive: needs: changes diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e22d76b029d2..fe1510711c19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,6 +44,7 @@ jobs: with: build_profile: release runner_provider: aws + license_type: enterprise # macos: # needs: linux diff --git a/.github/workflows/merge_group.yml b/.github/workflows/merge_group.yml index bc69873db068..7fb73638f6df 100644 --- a/.github/workflows/merge_group.yml +++ b/.github/workflows/merge_group.yml @@ -56,6 +56,7 @@ jobs: with: build_profile: release runner_provider: aws + license_type: enterprise ready: if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a08a02c1b58c..b956abaec2a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,6 +117,7 @@ jobs: uses: ./.github/actions/build_linux env: DATABEND_RELEASE_VERSION: ${{ needs.create_release.outputs.version }} + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.target }} @@ -149,6 +150,7 @@ jobs: uses: ./.github/actions/build_linux env: DATABEND_RELEASE_VERSION: ${{ needs.create_release.outputs.version }} + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.target }} @@ -173,6 +175,7 @@ jobs: uses: ./.github/actions/build_linux env: DATABEND_RELEASE_VERSION: ${{ needs.create_release.outputs.version }} + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.target }} diff --git a/.github/workflows/reuse.linux.hive.yml b/.github/workflows/reuse.linux.hive.yml index d91c8133195d..eeae250f4921 100644 --- a/.github/workflows/reuse.linux.hive.yml +++ b/.github/workflows/reuse.linux.hive.yml @@ -4,15 +4,15 @@ on: workflow_call: inputs: build_profile: - description: 'Build profile, debug or release' + description: "Build profile, debug or release" type: string required: true - default: 'debug' + default: "debug" runner_provider: - description: 'Self-hosted runner provider, aws or gcp' + description: "Self-hosted runner provider, aws or gcp" type: string required: true - default: 'aws' + default: "aws" env: BUILD_PROFILE: ${{ inputs.build_profile }} @@ -32,6 +32,8 @@ jobs: fetch-depth: 0 - uses: ./.github/actions/build_linux timeout-minutes: 60 + env: + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} diff --git a/.github/workflows/reuse.linux.yml b/.github/workflows/reuse.linux.yml index 51695f781331..116c6c719995 100644 --- a/.github/workflows/reuse.linux.yml +++ b/.github/workflows/reuse.linux.yml @@ -13,6 +13,11 @@ on: type: string required: true default: "aws" + license_type: + description: "License type, enterprise or trial" + type: string + required: true + default: "trial" env: BUILD_PROFILE: ${{ inputs.build_profile }} @@ -20,7 +25,7 @@ env: jobs: check: - runs-on: [ self-hosted, X64, Linux, 16c32g, "${{ inputs.runner_provider }}" ] + runs-on: [self-hosted, X64, Linux, 16c32g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 with: @@ -50,6 +55,8 @@ jobs: fetch-depth: 0 - uses: ./.github/actions/build_linux timeout-minutes: 60 + env: + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.arch }}-unknown-linux-gnu @@ -75,6 +82,8 @@ jobs: fetch-depth: 0 - uses: ./.github/actions/build_linux timeout-minutes: 60 + env: + DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} with: sha: ${{ github.sha }} target: ${{ matrix.arch }}-unknown-linux-gnu @@ -106,7 +115,7 @@ jobs: # artifacts: query test_unit: - runs-on: [ self-hosted, X64, Linux, 16c32g, "${{ inputs.runner_provider }}" ] + runs-on: [self-hosted, X64, Linux, 16c32g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 with: @@ -116,75 +125,76 @@ jobs: timeout-minutes: 60 test_metactl: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_metactl timeout-minutes: 10 test_compat_meta_query: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_compat_meta_query timeout-minutes: 10 test_compat_fuse: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_compat_fuse timeout-minutes: 20 test_compat_meta_meta: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_compat_meta_meta timeout-minutes: 20 test_logs: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_logs timeout-minutes: 20 test_meta_cluster: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_meta_cluster timeout-minutes: 10 test_stateless_standalone: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_stateless_standalone_linux timeout-minutes: 15 test_stateless_cluster: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_stateless_cluster_linux timeout-minutes: 15 test_stateful_standalone: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_stateful_standalone_linux @@ -196,13 +206,14 @@ jobs: name: test-stateful-standalone-linux test_stateful_cluster: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_stateful_cluster_linux timeout-minutes: 15 - name: Upload failure @@ -213,16 +224,16 @@ jobs: test_stateful_large_data: if: contains(github.event.pull_request.labels.*.name, 'ci-largedata') - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_stateful_large_data timeout-minutes: 60 test_stateful_iceberg_rest: - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] - needs: [ build, check ] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] + needs: [build, check] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/test_stateful_iceberg_rest_standalone @@ -243,13 +254,14 @@ jobs: # continue-on-error: true test_ee_standalone: - needs: [ build, check ] - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] + needs: [build, check] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_ee_standalone_linux timeout-minutes: 10 - name: Upload failure @@ -259,14 +271,15 @@ jobs: name: test-stateful-standalone-linux test_ee_standalone_background: - needs: [ build, check ] - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] + needs: [build, check] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_bendsql - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_ee_standalone_background_linux timeout-minutes: 10 - name: Upload failure @@ -288,6 +301,7 @@ jobs: # - uses: ./.github/actions/setup_license # with: # runner_provider: ${{ inputs.runner_provider }} + # type: ${{ inputs.license_type }} # - uses: ./.github/actions/test_ee_standalone_fake_time_linux # timeout-minutes: 10 # - name: Upload failure @@ -297,14 +311,15 @@ jobs: # name: test-stateful-standalone-fake-time-linux test_ee_management_mode: - needs: [ build, check ] - runs-on: [ self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}" ] + needs: [build, check] + runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_bendsql - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_ee_management_mode_linux timeout-minutes: 10 - name: Upload failure @@ -314,9 +329,10 @@ jobs: name: test-ee-management-mode-linux sqllogic: - needs: [ build, check ] + needs: [build, check] uses: ./.github/workflows/reuse.sqllogic.yml secrets: inherit with: build_profile: ${{ inputs.build_profile }} runner_provider: ${{ inputs.runner_provider }} + license_type: ${{ inputs.license_type }} diff --git a/.github/workflows/reuse.sqllogic.yml b/.github/workflows/reuse.sqllogic.yml index db3697bc5b56..ea56077fad83 100644 --- a/.github/workflows/reuse.sqllogic.yml +++ b/.github/workflows/reuse.sqllogic.yml @@ -13,6 +13,11 @@ on: type: string required: true default: "aws" + license_type: + description: "License type, enterprise or trial" + type: string + required: true + default: "trial" env: BUILD_PROFILE: ${{ inputs.build_profile }} @@ -196,6 +201,7 @@ jobs: - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_sqllogic_cluster_linux timeout-minutes: 15 with: @@ -266,6 +272,7 @@ jobs: - uses: ./.github/actions/setup_license with: runner_provider: ${{ inputs.runner_provider }} + type: ${{ inputs.license_type }} - uses: ./.github/actions/test_ee_sqllogic_standalone_linux timeout-minutes: 15 with: diff --git a/src/common/building/src/lib.rs b/src/common/building/src/lib.rs index 070381a7873c..70e2dacd281a 100644 --- a/src/common/building/src/lib.rs +++ b/src/common/building/src/lib.rs @@ -89,17 +89,17 @@ fn discover_version() -> Result { } } +pub fn add_env_license() { + let v = env::var("DATABEND_ENTERPRISE_LICENSE_EMBEDDED").unwrap_or_default(); + println!("cargo:rustc-env=DATABEND_ENTERPRISE_LICENSE_EMBEDDED={v}"); +} + pub fn add_license_public_key() { let v = env::var("DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY").unwrap_or_default(); let v = base64::Engine::encode(&base64::engine::general_purpose::STANDARD, v.as_bytes()); println!("cargo:rustc-env=DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY={v}"); } -pub fn add_env_license() { - let v = env::var("DATABEND_ENTERPRISE_LICENSE_EMBEDDED").unwrap_or_default(); - println!("cargo:rustc-env=DATABEND_ENTERPRISE_LICENSE_EMBEDDED={v}"); -} - pub fn add_env_commit_authors(repo: &Repository) { match git::get_commit_authors(repo) { Ok(authors) => println!("cargo:rustc-env=DATABEND_COMMIT_AUTHORS={}", authors), From 7abfa9616e84d047bfcb72821c15df46acf06a48 Mon Sep 17 00:00:00 2001 From: TCeason <33082201+TCeason@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:18:33 +0800 Subject: [PATCH 2/5] feat(query): support SHOW DROP DATABASES (#16811) add system.databases_with_history --- src/meta/api/src/schema_api_impl.rs | 1 - src/query/ast/src/ast/statements/database.rs | 20 + src/query/ast/src/ast/statements/statement.rs | 2 + src/query/ast/src/ast/statements/table.rs | 2 +- src/query/ast/src/parser/statement.rs | 14 + src/query/ast/tests/it/parser.rs | 2 + src/query/ast/tests/it/testdata/stmt.txt | 36 +- src/query/catalog/src/catalog/interface.rs | 3 + .../src/catalogs/default/database_catalog.rs | 11 + .../src/catalogs/default/immutable_catalog.rs | 4 + .../src/catalogs/default/mutable_catalog.rs | 27 + .../src/catalogs/default/session_catalog.rs | 5 + .../src/databases/system/system_database.rs | 6 +- .../access/management_mode_access.rs | 1 + .../interpreters/access/privilege_access.rs | 4 +- .../tests/it/sql/exec/get_table_bind_test.rs | 4 + .../it/storages/fuse/operations/commit.rs | 4 + src/query/service/tests/it/storages/system.rs | 23 +- .../it/storages/testdata/columns_table.txt | 1016 +++++++++-------- .../it/storages/testdata/databases_table.txt | 14 +- .../testdata/databases_with_history_table.txt | 12 + src/query/sql/src/planner/binder/binder.rs | 1 + .../sql/src/planner/binder/ddl/database.rs | 42 + src/query/sql/src/planner/plans/plan.rs | 1 + .../storages/hive/hive/src/hive_catalog.rs | 5 + src/query/storages/iceberg/src/catalog.rs | 4 + .../storages/system/src/databases_table.rs | 193 +++- src/query/storages/system/src/lib.rs | 2 + .../base/06_show/06_0009_show_databases.test | 5 + .../18_rbac/18_0003_db_visibility.result | 4 + .../18_rbac/18_0003_db_visibility.sh | 6 + 31 files changed, 906 insertions(+), 568 deletions(-) create mode 100644 src/query/service/tests/it/storages/testdata/databases_with_history_table.txt diff --git a/src/meta/api/src/schema_api_impl.rs b/src/meta/api/src/schema_api_impl.rs index 814ddc85d2ca..6070e4cac9aa 100644 --- a/src/meta/api/src/schema_api_impl.rs +++ b/src/meta/api/src/schema_api_impl.rs @@ -669,7 +669,6 @@ impl + ?Sized> SchemaApi for KV { name_ident: DatabaseNameIdent::new_from(db_id_list_key.clone()), meta: db_meta, }; - dbs.insert(db_id.db_id, Arc::new(db)); } } diff --git a/src/query/ast/src/ast/statements/database.rs b/src/query/ast/src/ast/statements/database.rs index 8541dd95c0fb..9f3808d99dce 100644 --- a/src/query/ast/src/ast/statements/database.rs +++ b/src/query/ast/src/ast/statements/database.rs @@ -49,6 +49,26 @@ impl Display for ShowDatabasesStmt { } } +#[derive(Debug, Clone, PartialEq, Drive, DriveMut)] +pub struct ShowDropDatabasesStmt { + pub catalog: Option, + pub limit: Option, +} + +impl Display for ShowDropDatabasesStmt { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + write!(f, "SHOW DROP DATABASES")?; + if let Some(catalog) = &self.catalog { + write!(f, " FROM {catalog}")?; + } + if let Some(limit) = &self.limit { + write!(f, " {limit}")?; + } + + Ok(()) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Drive, DriveMut)] pub struct ShowCreateDatabaseStmt { pub catalog: Option, diff --git a/src/query/ast/src/ast/statements/statement.rs b/src/query/ast/src/ast/statements/statement.rs index 6ccf682ddc0f..0c520fbd0b44 100644 --- a/src/query/ast/src/ast/statements/statement.rs +++ b/src/query/ast/src/ast/statements/statement.rs @@ -127,6 +127,7 @@ pub enum Statement { // Databases ShowDatabases(ShowDatabasesStmt), + ShowDropDatabases(ShowDropDatabasesStmt), ShowCreateDatabase(ShowCreateDatabaseStmt), CreateDatabase(CreateDatabaseStmt), DropDatabase(DropDatabaseStmt), @@ -548,6 +549,7 @@ impl Display for Statement { Statement::CreateCatalog(stmt) => write!(f, "{stmt}")?, Statement::DropCatalog(stmt) => write!(f, "{stmt}")?, Statement::ShowDatabases(stmt) => write!(f, "{stmt}")?, + Statement::ShowDropDatabases(stmt) => write!(f, "{stmt}")?, Statement::ShowCreateDatabase(stmt) => write!(f, "{stmt}")?, Statement::CreateDatabase(stmt) => write!(f, "{stmt}")?, Statement::DropDatabase(stmt) => write!(f, "{stmt}")?, diff --git a/src/query/ast/src/ast/statements/table.rs b/src/query/ast/src/ast/statements/table.rs index b37989c27993..57792449eebe 100644 --- a/src/query/ast/src/ast/statements/table.rs +++ b/src/query/ast/src/ast/statements/table.rs @@ -116,7 +116,7 @@ pub struct ShowDropTablesStmt { impl Display for ShowDropTablesStmt { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - write!(f, "SHOW DROP TABLE")?; + write!(f, "SHOW DROP TABLES")?; if let Some(database) = &self.database { write!(f, " FROM {database}")?; } diff --git a/src/query/ast/src/parser/statement.rs b/src/query/ast/src/parser/statement.rs index 0c581bfe5046..1705f94753fe 100644 --- a/src/query/ast/src/parser/statement.rs +++ b/src/query/ast/src/parser/statement.rs @@ -529,6 +529,19 @@ pub fn statement_body(i: Input) -> IResult { }) }, ); + + let show_drop_databases = map( + rule! { + SHOW ~ DROP ~ ( DATABASES | DATABASES ) ~ ( FROM ~ ^#ident )? ~ #show_limit? + }, + |(_, _, _, opt_catalog, limit)| { + Statement::ShowDropDatabases(ShowDropDatabasesStmt { + catalog: opt_catalog.map(|(_, catalog)| catalog), + limit, + }) + }, + ); + let show_create_database = map( rule! { SHOW ~ CREATE ~ ( DATABASE | SCHEMA ) ~ #dot_separated_idents_1_to_2 @@ -2284,6 +2297,7 @@ pub fn statement_body(i: Input) -> IResult { #show_databases : "`SHOW [FULL] DATABASES [(FROM | IN) ] []`" | #undrop_database : "`UNDROP DATABASE `" | #show_create_database : "`SHOW CREATE DATABASE `" + | #show_drop_databases : "`SHOW DROP DATABASES [FROM ] []`" | #create_database : "`CREATE [OR REPLACE] DATABASE [IF NOT EXISTS] [ENGINE = ]`" | #drop_database : "`DROP DATABASE [IF EXISTS] `" | #alter_database : "`ALTER DATABASE [IF EXISTS] `" diff --git a/src/query/ast/tests/it/parser.rs b/src/query/ast/tests/it/parser.rs index e249ca198fa5..9a536b2c2ee4 100644 --- a/src/query/ast/tests/it/parser.rs +++ b/src/query/ast/tests/it/parser.rs @@ -87,6 +87,8 @@ fn test_statement() { let file = &mut mint.new_goldenfile("stmt.txt").unwrap(); let cases = &[ r#"show databases"#, + r#"show drop databases"#, + r#"show drop databases like 'db%'"#, r#"show databases format TabSeparatedWithNamesAndTypes;"#, r#"show tables"#, r#"show drop tables"#, diff --git a/src/query/ast/tests/it/testdata/stmt.txt b/src/query/ast/tests/it/testdata/stmt.txt index 27869c0c54d2..8bd0d0d7a129 100644 --- a/src/query/ast/tests/it/testdata/stmt.txt +++ b/src/query/ast/tests/it/testdata/stmt.txt @@ -12,6 +12,36 @@ ShowDatabases( ) +---------- Input ---------- +show drop databases +---------- Output --------- +SHOW DROP DATABASES +---------- AST ------------ +ShowDropDatabases( + ShowDropDatabasesStmt { + catalog: None, + limit: None, + }, +) + + +---------- Input ---------- +show drop databases like 'db%' +---------- Output --------- +SHOW DROP DATABASES LIKE 'db%' +---------- AST ------------ +ShowDropDatabases( + ShowDropDatabasesStmt { + catalog: None, + limit: Some( + Like { + pattern: "db%", + }, + ), + }, +) + + ---------- Input ---------- show databases format TabSeparatedWithNamesAndTypes; ---------- Output --------- @@ -49,7 +79,7 @@ ShowTables( ---------- Input ---------- show drop tables ---------- Output --------- -SHOW DROP TABLE +SHOW DROP TABLES ---------- AST ------------ ShowDropTables( ShowDropTablesStmt { @@ -62,7 +92,7 @@ ShowDropTables( ---------- Input ---------- show drop tables like 't%' ---------- Output --------- -SHOW DROP TABLE LIKE 't%' +SHOW DROP TABLES LIKE 't%' ---------- AST ------------ ShowDropTables( ShowDropTablesStmt { @@ -79,7 +109,7 @@ ShowDropTables( ---------- Input ---------- show drop tables where name='t' ---------- Output --------- -SHOW DROP TABLE WHERE name = 't' +SHOW DROP TABLES WHERE name = 't' ---------- AST ------------ ShowDropTables( ShowDropTablesStmt { diff --git a/src/query/catalog/src/catalog/interface.rs b/src/query/catalog/src/catalog/interface.rs index 935c3706a9fc..4b2af1165132 100644 --- a/src/query/catalog/src/catalog/interface.rs +++ b/src/query/catalog/src/catalog/interface.rs @@ -152,6 +152,9 @@ pub trait Catalog: DynClone + Send + Sync + Debug { // Get the database by name. async fn get_database(&self, tenant: &Tenant, db_name: &str) -> Result>; + // List all databases history + async fn list_databases_history(&self, tenant: &Tenant) -> Result>>; + // Get all the databases. async fn list_databases(&self, tenant: &Tenant) -> Result>>; diff --git a/src/query/service/src/catalogs/default/database_catalog.rs b/src/query/service/src/catalogs/default/database_catalog.rs index b1ecc39360e4..b467d9939532 100644 --- a/src/query/service/src/catalogs/default/database_catalog.rs +++ b/src/query/service/src/catalogs/default/database_catalog.rs @@ -187,6 +187,17 @@ impl Catalog for DatabaseCatalog { } } + #[async_backtrace::framed] + async fn list_databases_history(&self, tenant: &Tenant) -> Result>> { + let mut dbs = self + .immutable_catalog + .list_databases_history(tenant) + .await?; + let mut other = self.mutable_catalog.list_databases_history(tenant).await?; + dbs.append(&mut other); + Ok(dbs) + } + #[async_backtrace::framed] async fn list_databases(&self, tenant: &Tenant) -> Result>> { let mut dbs = self.immutable_catalog.list_databases(tenant).await?; diff --git a/src/query/service/src/catalogs/default/immutable_catalog.rs b/src/query/service/src/catalogs/default/immutable_catalog.rs index cfb88afa8ad8..ac3cf23d1b85 100644 --- a/src/query/service/src/catalogs/default/immutable_catalog.rs +++ b/src/query/service/src/catalogs/default/immutable_catalog.rs @@ -170,6 +170,10 @@ impl Catalog for ImmutableCatalog { } } + async fn list_databases_history(&self, _tenant: &Tenant) -> Result>> { + Ok(vec![self.sys_db.clone(), self.info_schema_db.clone()]) + } + #[async_backtrace::framed] async fn list_databases(&self, _tenant: &Tenant) -> Result>> { Ok(vec![self.sys_db.clone(), self.info_schema_db.clone()]) diff --git a/src/query/service/src/catalogs/default/mutable_catalog.rs b/src/query/service/src/catalogs/default/mutable_catalog.rs index 07ae212bbdc2..4db4ef1e160c 100644 --- a/src/query/service/src/catalogs/default/mutable_catalog.rs +++ b/src/query/service/src/catalogs/default/mutable_catalog.rs @@ -243,6 +243,33 @@ impl Catalog for MutableCatalog { self.build_db_instance(&db_info) } + #[async_backtrace::framed] + async fn list_databases_history(&self, tenant: &Tenant) -> Result>> { + let dbs = self + .ctx + .meta + .get_tenant_history_databases( + ListDatabaseReq { + tenant: tenant.clone(), + }, + false, + ) + .await?; + + dbs.iter() + .try_fold(vec![], |mut acc, item: &Arc| { + let db_result = self.build_db_instance(item); + match db_result { + Ok(db) => acc.push(db), + Err(err) => { + // Ignore the error and continue, allow partial failure. + warn!("Failed to build database '{:?}': {:?}", item, err); + } + } + Ok(acc) + }) + } + #[async_backtrace::framed] async fn list_databases(&self, tenant: &Tenant) -> Result>> { let dbs = self diff --git a/src/query/service/src/catalogs/default/session_catalog.rs b/src/query/service/src/catalogs/default/session_catalog.rs index 7565b800c2f5..5ee189017537 100644 --- a/src/query/service/src/catalogs/default/session_catalog.rs +++ b/src/query/service/src/catalogs/default/session_catalog.rs @@ -153,6 +153,11 @@ impl Catalog for SessionCatalog { self.inner.get_database(tenant, db_name).await } + // List all the databases history. + async fn list_databases_history(&self, tenant: &Tenant) -> Result>> { + self.inner.list_databases_history(tenant).await + } + // Get all the databases. async fn list_databases(&self, tenant: &Tenant) -> Result>> { self.inner.list_databases(tenant).await diff --git a/src/query/service/src/databases/system/system_database.rs b/src/query/service/src/databases/system/system_database.rs index a4ad5c7d36d7..ccb6c693662d 100644 --- a/src/query/service/src/databases/system/system_database.rs +++ b/src/query/service/src/databases/system/system_database.rs @@ -34,7 +34,8 @@ use databend_common_storages_system::ColumnsTable; use databend_common_storages_system::ConfigsTable; use databend_common_storages_system::ContributorsTable; use databend_common_storages_system::CreditsTable; -use databend_common_storages_system::DatabasesTable; +use databend_common_storages_system::DatabasesTableWithHistory; +use databend_common_storages_system::DatabasesTableWithoutHistory; use databend_common_storages_system::DictionariesTable; use databend_common_storages_system::EnginesTable; use databend_common_storages_system::FullStreamsTable; @@ -103,7 +104,8 @@ impl SystemDatabase { TablesTableWithoutHistory::create(sys_db_meta.next_table_id()), TablesTableWithHistory::create(sys_db_meta.next_table_id()), ClustersTable::create(sys_db_meta.next_table_id()), - DatabasesTable::create(sys_db_meta.next_table_id()), + DatabasesTableWithHistory::create(sys_db_meta.next_table_id()), + DatabasesTableWithoutHistory::create(sys_db_meta.next_table_id()), FullStreamsTable::create(sys_db_meta.next_table_id()), TerseStreamsTable::create(sys_db_meta.next_table_id()), ProcessesTable::create(sys_db_meta.next_table_id()), diff --git a/src/query/service/src/interpreters/access/management_mode_access.rs b/src/query/service/src/interpreters/access/management_mode_access.rs index 09b6243180ae..22600b0383e9 100644 --- a/src/query/service/src/interpreters/access/management_mode_access.rs +++ b/src/query/service/src/interpreters/access/management_mode_access.rs @@ -45,6 +45,7 @@ impl AccessChecker for ManagementModeAccess { match rewrite_kind { Some(ref v) => matches!(v, RewriteKind::ShowDatabases + | RewriteKind::ShowDropDatabases | RewriteKind::ShowTables(_, _) | RewriteKind::ShowColumns(_, _, _) | RewriteKind::ShowEngines diff --git a/src/query/service/src/interpreters/access/privilege_access.rs b/src/query/service/src/interpreters/access/privilege_access.rs index e5ed82af8dc8..95d538266d3e 100644 --- a/src/query/service/src/interpreters/access/privilege_access.rs +++ b/src/query/service/src/interpreters/access/privilege_access.rs @@ -61,10 +61,11 @@ enum ObjectId { // some statements like `SELECT 1`, `SHOW USERS`, `SHOW ROLES`, `SHOW TABLES` will be // rewritten to the queries on the system tables, we need to skip the privilege check on // these tables. -const SYSTEM_TABLES_ALLOW_LIST: [&str; 20] = [ +const SYSTEM_TABLES_ALLOW_LIST: [&str; 21] = [ "catalogs", "columns", "databases", + "databases_with_history", "dictionaries", "tables", "views", @@ -708,6 +709,7 @@ impl AccessChecker for PrivilegeAccess { } => { match rewrite_kind { Some(RewriteKind::ShowDatabases) + | Some(RewriteKind::ShowDropDatabases) | Some(RewriteKind::ShowEngines) | Some(RewriteKind::ShowFunctions) | Some(RewriteKind::ShowUserFunctions) diff --git a/src/query/service/tests/it/sql/exec/get_table_bind_test.rs b/src/query/service/tests/it/sql/exec/get_table_bind_test.rs index a1cc8fce6f38..3cb3b651c17a 100644 --- a/src/query/service/tests/it/sql/exec/get_table_bind_test.rs +++ b/src/query/service/tests/it/sql/exec/get_table_bind_test.rs @@ -174,6 +174,10 @@ impl Catalog for FakedCatalog { todo!() } + async fn list_databases_history(&self, _tenant: &Tenant) -> Result>> { + todo!() + } + async fn list_databases(&self, _tenant: &Tenant) -> Result>> { todo!() } diff --git a/src/query/service/tests/it/storages/fuse/operations/commit.rs b/src/query/service/tests/it/storages/fuse/operations/commit.rs index fe5b5e69a207..ddceed7daac3 100644 --- a/src/query/service/tests/it/storages/fuse/operations/commit.rs +++ b/src/query/service/tests/it/storages/fuse/operations/commit.rs @@ -918,6 +918,10 @@ impl Catalog for FakedCatalog { todo!() } + async fn list_databases_history(&self, _tenant: &Tenant) -> Result>> { + todo!() + } + async fn create_database(&self, _req: CreateDatabaseReq) -> Result { todo!() } diff --git a/src/query/service/tests/it/storages/system.rs b/src/query/service/tests/it/storages/system.rs index b59ad6b13593..f556c12b4fe6 100644 --- a/src/query/service/tests/it/storages/system.rs +++ b/src/query/service/tests/it/storages/system.rs @@ -37,7 +37,8 @@ use databend_common_storages_system::ColumnsTable; use databend_common_storages_system::ConfigsTable; use databend_common_storages_system::ContributorsTable; use databend_common_storages_system::CreditsTable; -use databend_common_storages_system::DatabasesTable; +use databend_common_storages_system::DatabasesTableWithHistory; +use databend_common_storages_system::DatabasesTableWithoutHistory; use databend_common_storages_system::EnginesTable; use databend_common_storages_system::FunctionsTable; use databend_common_storages_system::MetricsTable; @@ -261,7 +262,7 @@ async fn test_databases_table() -> Result<()> { let fixture = TestFixture::setup_with_config(&config).await?; let ctx = fixture.new_query_ctx().await?; - let table = DatabasesTable::create(1); + let table = DatabasesTableWithoutHistory::create(1); let mut mint = Mint::new("tests/it/storages/testdata"); let file = &mut mint.new_goldenfile("databases_table.txt").unwrap(); @@ -270,6 +271,24 @@ async fn test_databases_table() -> Result<()> { Ok(()) } +#[tokio::test(flavor = "multi_thread")] +async fn test_databases_history_table() -> Result<()> { + let mut config = ConfigBuilder::create().build(); + config.storage.params = StorageParams::Fs(StorageFsConfig::default()); + let fixture = TestFixture::setup_with_config(&config).await?; + let ctx = fixture.new_query_ctx().await?; + + let table = DatabasesTableWithHistory::create(1); + + let mut mint = Mint::new("tests/it/storages/testdata"); + let file = &mut mint + .new_goldenfile("databases_with_history_table.txt") + .unwrap(); + run_table_tests(file, ctx, table).await?; + + Ok(()) +} + #[tokio::test(flavor = "multi_thread")] async fn test_engines_table() -> Result<()> { let fixture = TestFixture::setup().await?; diff --git a/src/query/service/tests/it/storages/testdata/columns_table.txt b/src/query/service/tests/it/storages/testdata/columns_table.txt index e217a3fc0d65..b18e7992fae0 100644 --- a/src/query/service/tests/it/storages/testdata/columns_table.txt +++ b/src/query/service/tests/it/storages/testdata/columns_table.txt @@ -1,510 +1,516 @@ ---------- TABLE INFO ------------ DB.Table: 'system'.'columns', Table: columns-table_id:1, ver:0, Engine: SystemColumns -------- TABLE CONTENTS ---------- -+-----------------------------------+----------------------+------------------------+-----------------------+---------------------+----------+----------+----------+----------+ -| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 | Column 8 | -+-----------------------------------+----------------------+------------------------+-----------------------+---------------------+----------+----------+----------+----------+ -| 'Comment' | 'system' | 'engines' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'Engine' | 'system' | 'engines' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'access' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'acquired_on' | 'system' | 'locks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'active_result_scan' | 'system' | 'query_cache' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'after' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'agg_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'agg_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'arguments' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'arguments' | 'system' | 'user_functions' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | -| 'attempt_number' | 'system' | 'task_history' | 'Int32' | 'INT' | '' | '' | 'NO' | '' | -| 'attribute_names' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | -| 'attribute_types' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | -| 'auth_type' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'auto_increment' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'byte_size' | 'system' | 'clustering_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'bytes_from_local_disk' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'bytes_from_memory' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'bytes_from_remote_disk' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'capacity' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'cardinality' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'cargo_features' | 'system' | 'build_options' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'databases' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'catalog_name' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'character_maximum_length' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'character_octet_length' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'character_set_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'character_set_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'character_set_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'check_option' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'client_address' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'client_info' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'cluster' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'cluster_by' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'cluster_by' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'cluster_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'collation' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'collation_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'collation_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'collation_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'column_comment' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'column_default' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'column_key' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'column_name' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'column_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'column_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'column_type' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'columns' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'command' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'notifications' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'comment' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'comment' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'comment' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'comment' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'compaction_stats' | 'system' | 'background_tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | -| 'completed_time' | 'system' | 'task_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'condition_text' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'condition_text' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'constraint_catalog' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'constraint_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'constraint_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'copy_options' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'cpu_usage' | 'system' | 'query_log' | 'UInt32' | 'INT UNSIGNED' | '' | '' | 'NO' | '' | -| 'create_time' | 'information_schema' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'background_jobs' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'background_tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'dictionaries' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'indexes' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'locks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'notification_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'notifications' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'password_policies' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'procedures' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'roles' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'stages' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'streams' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'tables_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'user_functions' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'users' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'created_on' | 'system' | 'views' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'views_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_on' | 'system' | 'virtual_columns' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'created_time' | 'system' | 'processes' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'creator' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'creator' | 'system' | 'background_tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'creator' | 'system' | 'stages' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'current_database' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'current_query_id' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'data_compressed_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'data_compressed_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'data_free' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'data_length' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'data_read_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'data_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'data_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'data_type' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'data_type' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'data_write_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'clustering_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'database_id' | 'system' | 'background_tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'database_id' | 'system' | 'databases' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'databases' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'datetime_precision' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'default' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'default' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'default_character_set_catalog' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'default_character_set_name' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'default_character_set_schema' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'default_collation_name' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'default_expression' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'default_kind' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'default_role' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'definition' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'definition' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'definition' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'definition' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'description' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'description' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'description' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'description' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'description' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'disabled' | 'system' | 'users' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'domain_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'domain_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'domain_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'drop_time' | 'information_schema' | 'tables' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'dropped_on' | 'system' | 'tables' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'dropped_on' | 'system' | 'tables_with_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'dropped_on' | 'system' | 'views' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'dropped_on' | 'system' | 'views_with_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'dummy' | 'system' | 'one' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'enabled' | 'system' | 'notifications' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'end_time' | 'system' | 'clustering_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'engine' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine_full' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine_full' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine_full' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'engine_full' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'error_integration' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'error_message' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'errors' | 'system' | 'queries_profiling' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | -| 'event_date' | 'system' | 'query_log' | 'Date' | 'DATE' | '' | '' | 'NO' | '' | -| 'event_time' | 'system' | 'query_log' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'example' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'exception_code' | 'system' | 'query_log' | 'Int32' | 'INT' | '' | '' | 'NO' | '' | -| 'exception_code' | 'system' | 'task_history' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | -| 'exception_text' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'exception_text' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'extra' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'extra' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'extra_info' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'extra_info' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'file_content_length' | 'system' | 'temp_files' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'file_format_options' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'file_last_modified_time' | 'system' | 'temp_files' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'file_name' | 'system' | 'temp_files' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'file_type' | 'system' | 'temp_files' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'group' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'group_by_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'group_by_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'handler_type' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'has_profile' | 'system' | 'query_log' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'hit' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'host' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'host' | 'system' | 'processes' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'hostname' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'id' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'id' | 'system' | 'notifications' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'id' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'id' | 'system' | 'task_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'id' | 'system' | 'tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'index_comment' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'index_length' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'index_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'index_schema' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'index_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'index_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'index_type' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'inherited_roles' | 'system' | 'roles' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'inherited_roles_name' | 'system' | 'roles' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'integration_name' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'invalid_reason' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_aggregate' | 'system' | 'functions' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'is_aggregate' | 'system' | 'user_functions' | 'Nullable(Boolean)' | 'BOOLEAN' | '' | '' | 'YES' | '' | -| 'is_attach' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_attach' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_configured' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_insertable_into' | 'information_schema' | 'views' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | -| 'is_nullable' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_nullable' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_transient' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_transient' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'is_trigger_deletable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'is_trigger_insertable_into' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'is_trigger_updatable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'is_updatable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'job_state' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'job_type' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'join_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'join_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'key_names' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | -| 'key_types' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | -| 'keywords' | 'information_schema' | 'keywords' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'kind' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'labels' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'language' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'last_committed_on' | 'system' | 'tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'last_suspended_on' | 'system' | 'tasks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'last_task_id' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'last_task_run_at' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'last_updated' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'level' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'license' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'location' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'log_type' | 'system' | 'query_log' | 'Int8' | 'TINYINT' | '' | '' | 'NO' | '' | -| 'log_type_name' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'memory_usage' | 'system' | 'processes' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | -| 'memory_usage' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'message' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'message' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'message' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'message_source' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'metric' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'miss' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'mode' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'mode' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'must_change_password' | 'system' | 'users' | 'Nullable(Boolean)' | 'BOOLEAN' | '' | '' | 'YES' | '' | -| 'mysql_connection_id' | 'system' | 'processes' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | -| 'name' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'catalogs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'contributors' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'databases' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'malloc_stats_totals' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'notifications' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'roles' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'table_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'name' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'network_policy' | 'system' | 'users' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'next_schedule_time' | 'system' | 'tasks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'next_task_scheduled_time' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'node' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'malloc_stats_totals' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node' | 'system' | 'queries_profiling' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'node_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'non_unique' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'nullable' | 'information_schema' | 'columns' | 'Nullable(UInt8)' | 'TINYINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'nullable' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'num_items' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'num_rows' | 'system' | 'query_cache' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'num_rows' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'num_rows' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'number_of_blocks' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'number_of_blocks' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'number_of_files' | 'system' | 'stages' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'number_of_segments' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'number_of_segments' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'numeric_precision' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'numeric_precision_radix' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'numeric_scale' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'options' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'ordinal_position' | 'information_schema' | 'columns' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'ordinal_position' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'original' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'owner' | 'system' | 'databases' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'stages' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'tables' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'tables_with_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'owner' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'owner' | 'system' | 'views' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'owner' | 'system' | 'views_with_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'packed' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'parent_plan_id' | 'system' | 'queries_profiling' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | -| 'partitions_sha' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'password_policy' | 'system' | 'users' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'plan_id' | 'system' | 'queries_profiling' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | -| 'plan_name' | 'system' | 'queries_profiling' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'port' | 'system' | 'clusters' | 'UInt16' | 'SMALLINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'position_in_unique_constraint' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'privileges' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'procedure_id' | 'system' | 'procedures' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'processed' | 'system' | 'notification_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'projections' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_duration_ms' | 'system' | 'query_log' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | -| 'query_hash' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'queries_profiling' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_kind' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_parameterized_hash' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'query_queued_duration_ms' | 'system' | 'query_log' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | -| 'query_start_time' | 'system' | 'query_log' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'query_text' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'range' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'referenced_column_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'referenced_table_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'referenced_table_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'reserved' | 'information_schema' | 'keywords' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'result_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'result_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'result_size' | 'system' | 'query_cache' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'revision' | 'system' | 'locks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'roles' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'root_task_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'row_count' | 'system' | 'clustering_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'run_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'scan_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_io_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_io_bytes_cost_ms' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_partitions' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_progress_read_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_progress_read_rows' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'scan_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'schedule' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'schedule' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'scheduled_job_cron_expression' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'scheduled_job_cron_timezone' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'scheduled_job_interval_secs' | 'system' | 'background_jobs' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'scheduled_time' | 'system' | 'task_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'schema_name' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'schema_owner' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'seq_in_index' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'server_version' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'session_parameters' | 'system' | 'task_history' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | -| 'session_parameters' | 'system' | 'tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | -| 'session_settings' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'size' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'snapshot_location' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'source' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'sql' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'sql_path' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'sql_user' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'sql_user_privileges' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'sql_user_quota' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'stack' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'stack_trace' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'stage_params' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'stage_type' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'start_time' | 'system' | 'clustering_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'state' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'state' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'state' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'statistics' | 'system' | 'malloc_stats' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | -| 'statistics' | 'system' | 'queries_profiling' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | -| 'status' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'status' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'status' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'status' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'stream_id' | 'system' | 'streams' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'sub_part' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'suspend_task_after_num_failures' | 'system' | 'tasks' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'syntax' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table' | 'system' | 'clustering_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_catalog' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_catalog' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_catalog' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_catalog' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_catalog' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_collation' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_comment' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'background_tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'locks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'streams' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'table_id' | 'system' | 'tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'tables_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'temporary_tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'views' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_id' | 'system' | 'views_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'table_name' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_name' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_name' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_name' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'table_name' | 'system' | 'streams_terse' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'table_rows' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'table_schema' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_schema' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | -| 'table_schema' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_schema' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_type' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_type' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_type' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'table_version' | 'system' | 'streams' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'tables' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'target_features' | 'system' | 'build_options' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'task_running_secs' | 'system' | 'background_tasks' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | -| 'task_type' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'tenant_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'time' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'total_columns' | 'system' | 'tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'total_columns' | 'system' | 'tables_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'total_partitions' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'trigger' | 'system' | 'background_tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'type' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'notifications' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'type' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'unit' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'update_on' | 'system' | 'roles' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'update_on' | 'system' | 'users' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'updated_on' | 'system' | 'background_tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'dictionaries' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'indexes' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'updated_on' | 'system' | 'password_policies' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'updated_on' | 'system' | 'streams' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'tables_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'views' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'views_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | -| 'updated_on' | 'system' | 'virtual_columns' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | -| 'user' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'user' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'user_agent' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'vacuum_stats' | 'system' | 'background_tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | -| 'value' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'value' | 'system' | 'malloc_stats_totals' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'value' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'value' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'version' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'version' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'view_definition' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'view_query' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'view_query' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'virtual_columns' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | -| 'warehouse' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'warehouse' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | -| 'webhook_options' | 'system' | 'notifications' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | -| 'written_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'written_io_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'written_io_bytes_cost_ms' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -| 'written_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | -+-----------------------------------+----------------------+------------------------+-----------------------+---------------------+----------+----------+----------+----------+ ++-----------------------------------+----------------------+--------------------------+-----------------------+---------------------+----------+----------+----------+----------+ +| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 | Column 8 | ++-----------------------------------+----------------------+--------------------------+-----------------------+---------------------+----------+----------+----------+----------+ +| 'Comment' | 'system' | 'engines' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'Engine' | 'system' | 'engines' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'access' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'acquired_on' | 'system' | 'locks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'active_result_scan' | 'system' | 'query_cache' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'after' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'agg_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'agg_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'arguments' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'arguments' | 'system' | 'user_functions' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | +| 'attempt_number' | 'system' | 'task_history' | 'Int32' | 'INT' | '' | '' | 'NO' | '' | +| 'attribute_names' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | +| 'attribute_types' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | +| 'auth_type' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'auto_increment' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'byte_size' | 'system' | 'clustering_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'bytes_from_local_disk' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'bytes_from_memory' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'bytes_from_remote_disk' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'capacity' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'cardinality' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'cargo_features' | 'system' | 'build_options' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'databases' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'databases_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'catalog_name' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'character_maximum_length' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'character_octet_length' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'character_set_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'character_set_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'character_set_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'check_option' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'client_address' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'client_info' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'cluster' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'cluster_by' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'cluster_by' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'cluster_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'collation' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'collation_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'collation_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'collation_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'column_comment' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'column_default' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'column_key' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'column_name' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'column_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'column_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'column_type' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'columns' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'command' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'notifications' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'comment' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'comment' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'comment' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'comment' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'compaction_stats' | 'system' | 'background_tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | +| 'completed_time' | 'system' | 'task_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'condition_text' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'condition_text' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'constraint_catalog' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'constraint_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'constraint_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'copy_options' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'cpu_usage' | 'system' | 'query_log' | 'UInt32' | 'INT UNSIGNED' | '' | '' | 'NO' | '' | +| 'create_time' | 'information_schema' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'background_jobs' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'background_tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'dictionaries' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'indexes' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'locks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'notification_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'notifications' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'password_policies' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'procedures' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'roles' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'stages' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'streams' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'tables_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'user_functions' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'users' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'created_on' | 'system' | 'views' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'views_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_on' | 'system' | 'virtual_columns' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'created_time' | 'system' | 'processes' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'creator' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'creator' | 'system' | 'background_tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'creator' | 'system' | 'stages' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'current_database' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'current_query_id' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'data_compressed_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'data_compressed_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'data_free' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'data_length' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'data_read_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'data_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'data_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'data_type' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'data_type' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'data_write_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'clustering_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'database_id' | 'system' | 'background_tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'database_id' | 'system' | 'databases' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'database_id' | 'system' | 'databases_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'databases' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'datetime_precision' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'default' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'default' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'default_character_set_catalog' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'default_character_set_name' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'default_character_set_schema' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'default_collation_name' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'default_expression' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'default_kind' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'default_role' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'definition' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'definition' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'definition' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'definition' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'description' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'description' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'description' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'description' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'description' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'disabled' | 'system' | 'users' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'domain_catalog' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'domain_name' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'domain_schema' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'drop_time' | 'information_schema' | 'tables' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'databases' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'databases_with_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'tables' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'tables_with_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'views' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dropped_on' | 'system' | 'views_with_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'dummy' | 'system' | 'one' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'enabled' | 'system' | 'notifications' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'end_time' | 'system' | 'clustering_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'engine' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine_full' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine_full' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine_full' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'engine_full' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'error_integration' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'error_message' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'errors' | 'system' | 'queries_profiling' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | +| 'event_date' | 'system' | 'query_log' | 'Date' | 'DATE' | '' | '' | 'NO' | '' | +| 'event_time' | 'system' | 'query_log' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'example' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'exception_code' | 'system' | 'query_log' | 'Int32' | 'INT' | '' | '' | 'NO' | '' | +| 'exception_code' | 'system' | 'task_history' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | +| 'exception_text' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'exception_text' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'extra' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'extra' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'extra_info' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'extra_info' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'file_content_length' | 'system' | 'temp_files' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'file_format_options' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'file_last_modified_time' | 'system' | 'temp_files' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'file_name' | 'system' | 'temp_files' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'file_type' | 'system' | 'temp_files' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'group' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'group_by_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'group_by_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'handler_type' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'has_profile' | 'system' | 'query_log' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'hit' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'host' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'host' | 'system' | 'processes' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'hostname' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'id' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'id' | 'system' | 'notifications' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'id' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'id' | 'system' | 'task_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'id' | 'system' | 'tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'index_comment' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'index_length' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'index_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'index_schema' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'index_size' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'index_size' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'index_type' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'inherited_roles' | 'system' | 'roles' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'inherited_roles_name' | 'system' | 'roles' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'integration_name' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'invalid_reason' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_aggregate' | 'system' | 'functions' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'is_aggregate' | 'system' | 'user_functions' | 'Nullable(Boolean)' | 'BOOLEAN' | '' | '' | 'YES' | '' | +| 'is_attach' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_attach' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_configured' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_insertable_into' | 'information_schema' | 'views' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' | +| 'is_nullable' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_nullable' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_transient' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_transient' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'is_trigger_deletable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'is_trigger_insertable_into' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'is_trigger_updatable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'is_updatable' | 'information_schema' | 'views' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'job_state' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'job_type' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'join_spilled_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'join_spilled_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'key_names' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | +| 'key_types' | 'system' | 'dictionaries' | 'Array(String)' | 'ARRAY(STRING)' | '' | '' | 'NO' | '' | +| 'keywords' | 'information_schema' | 'keywords' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'kind' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'labels' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'language' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'last_committed_on' | 'system' | 'tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'last_suspended_on' | 'system' | 'tasks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'last_task_id' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'last_task_run_at' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'last_updated' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'level' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'license' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'location' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'log_type' | 'system' | 'query_log' | 'Int8' | 'TINYINT' | '' | '' | 'NO' | '' | +| 'log_type_name' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'memory_usage' | 'system' | 'processes' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | +| 'memory_usage' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'message' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'message' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'message' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'message_source' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'metric' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'miss' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'mode' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'mode' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'must_change_password' | 'system' | 'users' | 'Nullable(Boolean)' | 'BOOLEAN' | '' | '' | 'YES' | '' | +| 'mysql_connection_id' | 'system' | 'processes' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | +| 'name' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'catalogs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'contributors' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'databases' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'databases_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'malloc_stats_totals' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'notifications' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'procedures' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'roles' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'streams' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'streams_terse' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'table_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'temporary_tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'user_functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'name' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'network_policy' | 'system' | 'users' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'next_schedule_time' | 'system' | 'tasks' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'next_task_scheduled_time' | 'system' | 'background_jobs' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'node' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'malloc_stats_totals' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node' | 'system' | 'queries_profiling' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'node_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'non_unique' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'nullable' | 'information_schema' | 'columns' | 'Nullable(UInt8)' | 'TINYINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'nullable' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'num_items' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'num_rows' | 'system' | 'query_cache' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'num_rows' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'num_rows' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'number_of_blocks' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'number_of_blocks' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'number_of_files' | 'system' | 'stages' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'number_of_segments' | 'system' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'number_of_segments' | 'system' | 'tables_with_history' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'numeric_precision' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'numeric_precision_radix' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'numeric_scale' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'options' | 'system' | 'password_policies' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'ordinal_position' | 'information_schema' | 'columns' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'ordinal_position' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'original' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'owner' | 'system' | 'databases' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'databases_with_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'stages' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'tables' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'tables_with_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'owner' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'owner' | 'system' | 'views' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'owner' | 'system' | 'views_with_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'packed' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'parent_plan_id' | 'system' | 'queries_profiling' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | +| 'partitions_sha' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'password_policy' | 'system' | 'users' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'plan_id' | 'system' | 'queries_profiling' | 'Nullable(UInt32)' | 'INT UNSIGNED' | '' | '' | 'YES' | '' | +| 'plan_name' | 'system' | 'queries_profiling' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'port' | 'system' | 'clusters' | 'UInt16' | 'SMALLINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'position_in_unique_constraint' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'privileges' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'procedure_id' | 'system' | 'procedures' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'processed' | 'system' | 'notification_history' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'projections' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_duration_ms' | 'system' | 'query_log' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | +| 'query_hash' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'queries_profiling' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_kind' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_parameterized_hash' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'query_queued_duration_ms' | 'system' | 'query_log' | 'Int64' | 'BIGINT' | '' | '' | 'NO' | '' | +| 'query_start_time' | 'system' | 'query_log' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'query_text' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'range' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'referenced_column_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'referenced_table_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'referenced_table_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'reserved' | 'information_schema' | 'keywords' | 'UInt8' | 'TINYINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'result_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'result_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'result_size' | 'system' | 'query_cache' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'revision' | 'system' | 'locks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'roles' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'root_task_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'row_count' | 'system' | 'clustering_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'run_id' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'scan_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_io_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_io_bytes_cost_ms' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_partitions' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_progress_read_bytes' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_progress_read_rows' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'scan_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'schedule' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'schedule' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'scheduled_job_cron_expression' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'scheduled_job_cron_timezone' | 'system' | 'background_jobs' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'scheduled_job_interval_secs' | 'system' | 'background_jobs' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'scheduled_time' | 'system' | 'task_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'schema_name' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'schema_owner' | 'information_schema' | 'schemata' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'seq_in_index' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'server_version' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'session_parameters' | 'system' | 'task_history' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | +| 'session_parameters' | 'system' | 'tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | +| 'session_settings' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'size' | 'system' | 'caches' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'snapshot_location' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'source' | 'system' | 'dictionaries' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'sql' | 'system' | 'query_cache' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'sql_path' | 'information_schema' | 'schemata' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'sql_user' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'sql_user_privileges' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'sql_user_quota' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'stack' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'stack_trace' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'stage_params' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'stage_type' | 'system' | 'stages' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'start_time' | 'system' | 'clustering_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'state' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'state' | 'system' | 'task_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'state' | 'system' | 'tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'statistics' | 'system' | 'malloc_stats' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | +| 'statistics' | 'system' | 'queries_profiling' | 'Variant' | 'VARIANT' | '' | '' | 'NO' | '' | +| 'status' | 'system' | 'backtrace' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'status' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'status' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'status' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'stream_id' | 'system' | 'streams' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'sub_part' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'suspend_task_after_num_failures' | 'system' | 'tasks' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'syntax' | 'system' | 'functions' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table' | 'system' | 'clustering_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_catalog' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_catalog' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_catalog' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_catalog' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_catalog' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_collation' | 'information_schema' | 'tables' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_comment' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'background_tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'locks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'streams' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'table_id' | 'system' | 'tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'tables_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'temporary_tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'views' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_id' | 'system' | 'views_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'table_name' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_name' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_name' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_name' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_name' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_name' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'table_name' | 'system' | 'streams_terse' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'table_rows' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'table_schema' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_schema' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' | +| 'table_schema' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_schema' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_type' | 'information_schema' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_type' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_type' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'table_version' | 'system' | 'streams' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'tables' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'target_features' | 'system' | 'build_options' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'task_running_secs' | 'system' | 'background_tasks' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' | +| 'task_type' | 'system' | 'background_jobs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'tenant_id' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'time' | 'system' | 'processes' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'total_columns' | 'system' | 'tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'total_columns' | 'system' | 'tables_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'total_partitions' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'trigger' | 'system' | 'background_tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'type' | 'system' | 'background_tasks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'indexes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'notifications' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'type' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'unit' | 'system' | 'caches' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'update_on' | 'system' | 'roles' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'update_on' | 'system' | 'users' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'updated_on' | 'system' | 'background_tasks' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'dictionaries' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'indexes' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'updated_on' | 'system' | 'password_policies' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'updated_on' | 'system' | 'streams' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'tables' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'tables_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'views' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'views_with_history' | 'Timestamp' | 'TIMESTAMP' | '' | '' | 'NO' | '' | +| 'updated_on' | 'system' | 'virtual_columns' | 'Nullable(Timestamp)' | 'TIMESTAMP' | '' | '' | 'YES' | '' | +| 'user' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'user' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'user_agent' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'vacuum_stats' | 'system' | 'background_tasks' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | +| 'value' | 'system' | 'configs' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'value' | 'system' | 'malloc_stats_totals' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'value' | 'system' | 'metrics' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'value' | 'system' | 'settings' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'version' | 'system' | 'clusters' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'version' | 'system' | 'credits' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'view_definition' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'view_query' | 'system' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'view_query' | 'system' | 'views_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'virtual_columns' | 'system' | 'virtual_columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' | +| 'warehouse' | 'system' | 'task_history' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'warehouse' | 'system' | 'tasks' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' | +| 'webhook_options' | 'system' | 'notifications' | 'Nullable(Variant)' | 'VARIANT' | '' | '' | 'YES' | '' | +| 'written_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'written_io_bytes' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'written_io_bytes_cost_ms' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | +| 'written_rows' | 'system' | 'query_log' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' | ++-----------------------------------+----------------------+--------------------------+-----------------------+---------------------+----------+----------+----------+----------+ diff --git a/src/query/service/tests/it/storages/testdata/databases_table.txt b/src/query/service/tests/it/storages/testdata/databases_table.txt index 286957a4934b..a18103a8b1eb 100644 --- a/src/query/service/tests/it/storages/testdata/databases_table.txt +++ b/src/query/service/tests/it/storages/testdata/databases_table.txt @@ -1,12 +1,12 @@ ---------- TABLE INFO ------------ DB.Table: 'system'.'databases', Table: databases-table_id:1, ver:0, Engine: SystemDatabases -------- TABLE CONTENTS ---------- -+-----------+----------------------+---------------------+----------+ -| Column 0 | Column 1 | Column 2 | Column 3 | -+-----------+----------------------+---------------------+----------+ -| 'default' | 'default' | 1 | NULL | -| 'default' | 'information_schema' | 4611686018427387906 | NULL | -| 'default' | 'system' | 4611686018427387905 | NULL | -+-----------+----------------------+---------------------+----------+ ++-----------+----------------------+---------------------+----------+----------+ +| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | ++-----------+----------------------+---------------------+----------+----------+ +| 'default' | 'default' | 1 | NULL | NULL | +| 'default' | 'information_schema' | 4611686018427387906 | NULL | NULL | +| 'default' | 'system' | 4611686018427387905 | NULL | NULL | ++-----------+----------------------+---------------------+----------+----------+ diff --git a/src/query/service/tests/it/storages/testdata/databases_with_history_table.txt b/src/query/service/tests/it/storages/testdata/databases_with_history_table.txt new file mode 100644 index 000000000000..d9a4ded4d128 --- /dev/null +++ b/src/query/service/tests/it/storages/testdata/databases_with_history_table.txt @@ -0,0 +1,12 @@ +---------- TABLE INFO ------------ +DB.Table: 'system'.'databases_with_history', Table: databases_with_history-table_id:1, ver:0, Engine: SystemDatabases +-------- TABLE CONTENTS ---------- ++-----------+----------------------+---------------------+----------+----------+ +| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | ++-----------+----------------------+---------------------+----------+----------+ +| 'default' | 'default' | 1 | NULL | NULL | +| 'default' | 'information_schema' | 4611686018427387906 | NULL | NULL | +| 'default' | 'system' | 4611686018427387905 | NULL | NULL | ++-----------+----------------------+---------------------+----------+----------+ + + diff --git a/src/query/sql/src/planner/binder/binder.rs b/src/query/sql/src/planner/binder/binder.rs index c38bdc067f1c..abc243ae2cc0 100644 --- a/src/query/sql/src/planner/binder/binder.rs +++ b/src/query/sql/src/planner/binder/binder.rs @@ -268,6 +268,7 @@ impl<'a> Binder { // Databases Statement::ShowDatabases(stmt) => self.bind_show_databases(bind_context, stmt).await?, + Statement::ShowDropDatabases(stmt) => self.bind_show_drop_databases(bind_context, stmt).await?, Statement::ShowCreateDatabase(stmt) => self.bind_show_create_database(stmt).await?, Statement::CreateDatabase(stmt) => self.bind_create_database(stmt).await?, Statement::DropDatabase(stmt) => self.bind_drop_database(stmt).await?, diff --git a/src/query/sql/src/planner/binder/ddl/database.rs b/src/query/sql/src/planner/binder/ddl/database.rs index ad5028ee3b33..f4991733dd8b 100644 --- a/src/query/sql/src/planner/binder/ddl/database.rs +++ b/src/query/sql/src/planner/binder/ddl/database.rs @@ -23,6 +23,7 @@ use databend_common_ast::ast::DropDatabaseStmt; use databend_common_ast::ast::SQLProperty; use databend_common_ast::ast::ShowCreateDatabaseStmt; use databend_common_ast::ast::ShowDatabasesStmt; +use databend_common_ast::ast::ShowDropDatabasesStmt; use databend_common_ast::ast::ShowLimit; use databend_common_ast::ast::UndropDatabaseStmt; use databend_common_exception::Result; @@ -93,6 +94,47 @@ impl Binder { .await } + #[async_backtrace::framed] + pub(in crate::planner::binder) async fn bind_show_drop_databases( + &mut self, + bind_context: &mut BindContext, + stmt: &ShowDropDatabasesStmt, + ) -> Result { + let ShowDropDatabasesStmt { catalog, limit } = stmt; + let mut select_builder = SelectBuilder::from("system.databases_with_history"); + + let ctl = if let Some(ctl) = catalog { + normalize_identifier(ctl, &self.name_resolution_ctx).name + } else { + self.ctx.get_current_catalog().to_string() + }; + + select_builder.with_filter(format!("catalog = '{ctl}'")); + + select_builder.with_column("catalog"); + select_builder.with_column("name"); + select_builder.with_column("database_id"); + select_builder.with_column("dropped_on"); + + select_builder.with_order_by("catalog"); + select_builder.with_order_by("name"); + + match limit { + Some(ShowLimit::Like { pattern }) => { + select_builder.with_filter(format!("name LIKE '{pattern}'")); + } + Some(ShowLimit::Where { selection }) => { + select_builder.with_filter(format!("({selection})")); + } + None => (), + } + let query = select_builder.build(); + debug!("show databases rewrite to: {:?}", query); + + self.bind_rewrite_to_query(bind_context, query.as_str(), RewriteKind::ShowDropDatabases) + .await + } + #[async_backtrace::framed] pub(in crate::planner::binder) async fn bind_show_create_database( &self, diff --git a/src/query/sql/src/planner/plans/plan.rs b/src/query/sql/src/planner/plans/plan.rs index 80556dbbcdd6..da139fa99e92 100644 --- a/src/query/sql/src/planner/plans/plan.rs +++ b/src/query/sql/src/planner/plans/plan.rs @@ -389,6 +389,7 @@ pub enum RewriteKind { ShowCatalogs, ShowDatabases, + ShowDropDatabases, ShowTables(String, String), ShowColumns(String, String, String), ShowTablesStatus, diff --git a/src/query/storages/hive/hive/src/hive_catalog.rs b/src/query/storages/hive/hive/src/hive_catalog.rs index 990dd0607937..3e547a2258dc 100644 --- a/src/query/storages/hive/hive/src/hive_catalog.rs +++ b/src/query/storages/hive/hive/src/hive_catalog.rs @@ -293,6 +293,11 @@ impl Catalog for HiveCatalog { Ok(res) } + async fn list_databases_history(&self, _tenant: &Tenant) -> Result>> { + // TODO: Implement list_databases_history + unimplemented!() + } + // Get all the databases. #[fastrace::trace] #[async_backtrace::framed] diff --git a/src/query/storages/iceberg/src/catalog.rs b/src/query/storages/iceberg/src/catalog.rs index 92ef717b8685..664cec399f21 100644 --- a/src/query/storages/iceberg/src/catalog.rs +++ b/src/query/storages/iceberg/src/catalog.rs @@ -226,6 +226,10 @@ impl Catalog for IcebergCatalog { Ok(Arc::new(IcebergDatabase::create(self.clone(), db_name))) } + async fn list_databases_history(&self, _tenant: &Tenant) -> Result>> { + unimplemented!() + } + #[async_backtrace::framed] async fn list_databases(&self, _tenant: &Tenant) -> Result>> { let db_names = self diff --git a/src/query/storages/system/src/databases_table.rs b/src/query/storages/system/src/databases_table.rs index cfebe2c1b97f..4adbbb880d73 100644 --- a/src/query/storages/system/src/databases_table.rs +++ b/src/query/storages/system/src/databases_table.rs @@ -16,12 +16,14 @@ use std::sync::Arc; use databend_common_catalog::catalog::Catalog; use databend_common_catalog::catalog::CatalogManager; +use databend_common_catalog::database::Database; use databend_common_catalog::plan::PushDownInfo; use databend_common_catalog::table::Table; use databend_common_catalog::table_context::TableContext; use databend_common_exception::Result; use databend_common_expression::types::NumberDataType; use databend_common_expression::types::StringType; +use databend_common_expression::types::TimestampType; use databend_common_expression::types::UInt64Type; use databend_common_expression::utils::FromData; use databend_common_expression::DataBlock; @@ -33,19 +35,60 @@ use databend_common_meta_app::schema::database_name_ident::DatabaseNameIdent; use databend_common_meta_app::schema::TableIdent; use databend_common_meta_app::schema::TableInfo; use databend_common_meta_app::schema::TableMeta; +use databend_common_meta_app::tenant::Tenant; use databend_common_users::UserApiProvider; use log::warn; use crate::table::AsyncOneBlockSystemTable; use crate::table::AsyncSystemTable; -pub struct DatabasesTable { +pub type DatabasesTableWithHistory = DatabasesTable; +pub type DatabasesTableWithoutHistory = DatabasesTable; + +pub struct DatabasesTable { table_info: TableInfo, } #[async_trait::async_trait] -impl AsyncSystemTable for DatabasesTable { - const NAME: &'static str = "system.databases"; +pub trait HistoryAware { + const TABLE_NAME: &'static str; + async fn list_databases( + catalog: &Arc, + tenant: &Tenant, + with_history: bool, + ) -> Result>>; +} + +macro_rules! impl_history_aware { + ($with_history:expr, $table_name:expr) => { + #[async_trait::async_trait] + impl HistoryAware for DatabasesTable<$with_history> { + const TABLE_NAME: &'static str = $table_name; + + #[async_backtrace::framed] + async fn list_databases( + catalog: &Arc, + tenant: &Tenant, + with_history: bool, + ) -> Result>> { + if with_history { + catalog.list_databases_history(tenant).await + } else { + catalog.list_databases(tenant).await + } + } + } + }; +} + +impl_history_aware!(true, "databases_with_history"); +impl_history_aware!(false, "databases"); + +#[async_trait::async_trait] +impl AsyncSystemTable for DatabasesTable +where DatabasesTable: HistoryAware +{ + const NAME: &'static str = Self::TABLE_NAME; fn get_table_info(&self) -> &TableInfo { &self.table_info @@ -72,57 +115,106 @@ impl AsyncSystemTable for DatabasesTable { let mut db_names = vec![]; let mut db_ids = vec![]; let mut owners: Vec> = vec![]; + let mut dropped_on: Vec> = vec![]; let visibility_checker = ctx.get_visibility_checker().await?; let catalog_dbs = visibility_checker.get_visibility_database(); // None means has global level privileges if let Some(catalog_dbs) = catalog_dbs { - for (catalog, dbs) in catalog_dbs { - let mut catalog_db_ids = vec![]; - let mut catalog_db_names = vec![]; - let ctl = ctx.get_catalog(catalog).await?; - catalog_db_names.extend( - dbs.iter() - .filter_map(|(db_name, _)| *db_name) - .map(|db_name| db_name.to_string()), - ); - catalog_db_ids.extend(dbs.iter().filter_map(|(_, db_id)| *db_id)); - - if let Ok(databases) = ctl - .mget_database_names_by_ids(&tenant, &catalog_db_ids) - .await - { - catalog_db_names.extend(databases.into_iter().flatten()); - } else { - let msg = format!("Failed to get database name by id: {}", ctl.name()); - warn!("{}", msg); + if WITH_HISTORY { + for (ctl_name, dbs) in catalog_dbs { + let catalog = ctx.get_catalog(ctl_name).await?; + let dbs_history = catalog.list_databases_history(&tenant).await?; + for db_history in dbs_history { + let db_name = db_history + .get_db_info() + .name_ident + .database_name() + .to_string(); + let id = db_history.get_db_info().database_id.db_id; + if db_ids.contains(&id) { + continue; + } + if dbs.contains(&(None, Some(&id))) + || db_name.to_lowercase() == "information_schema" + || db_name.to_lowercase() == "system" + { + catalog_names.push(ctl_name.clone()); + db_names.push(db_name); + db_ids.push(id); + owners.push( + user_api + .get_ownership(&tenant, &OwnershipObject::Database { + catalog_name: ctl_name.to_string(), + db_id: id, + }) + .await + .ok() + .and_then(|ownership| ownership.map(|o| o.role.clone())), + ); + dropped_on.push( + db_history + .get_db_info() + .meta + .drop_on + .map(|v| v.timestamp_micros()), + ); + } + } } - - let db_idents = catalog_db_names - .iter() - .map(|name| DatabaseNameIdent::new(&tenant, name)) - .collect::>(); - let dbs = ctl.mget_databases(&tenant, &db_idents).await?; - for db in dbs { - catalog_names.push(catalog.clone()); - db_names.push(db.get_db_info().name_ident.database_name().to_string()); - let db_id = db.get_db_info().database_id.db_id; - db_ids.push(db_id); - owners.push( - user_api - .get_ownership(&tenant, &OwnershipObject::Database { - catalog_name: catalog.to_string(), - db_id, - }) - .await - .ok() - .and_then(|ownership| ownership.map(|o| o.role.clone())), + } else { + for (catalog, dbs) in catalog_dbs { + let mut catalog_db_ids = vec![]; + let mut catalog_db_names = vec![]; + let ctl = ctx.get_catalog(catalog).await?; + catalog_db_names.extend( + dbs.iter() + .filter_map(|(db_name, _)| *db_name) + .map(|db_name| db_name.to_string()), ); + catalog_db_ids.extend(dbs.iter().filter_map(|(_, db_id)| *db_id)); + + if let Ok(databases) = ctl + .mget_database_names_by_ids(&tenant, &catalog_db_ids) + .await + { + catalog_db_names.extend(databases.into_iter().flatten()); + } else { + let msg = format!("Failed to get database name by id: {}", ctl.name()); + warn!("{}", msg); + } + let db_idents = catalog_db_names + .iter() + .map(|name| DatabaseNameIdent::new(&tenant, name)) + .collect::>(); + let dbs = ctl.mget_databases(&tenant, &db_idents).await?; + + for db in dbs { + let db_id = db.get_db_info().database_id.db_id; + if db_ids.contains(&db_id) { + continue; + } + catalog_names.push(catalog.clone()); + db_names.push(db.get_db_info().name_ident.database_name().to_string()); + db_ids.push(db_id); + owners.push( + user_api + .get_ownership(&tenant, &OwnershipObject::Database { + catalog_name: catalog.to_string(), + db_id, + }) + .await + .ok() + .and_then(|ownership| ownership.map(|o| o.role.clone())), + ); + dropped_on + .push(db.get_db_info().meta.drop_on.map(|v| v.timestamp_micros())); + } } } } else { for (ctl_name, catalog) in catalogs.into_iter() { - let databases = catalog.list_databases(&tenant).await?; + let databases = Self::list_databases(&catalog, &tenant, WITH_HISTORY).await?; let final_dbs = databases .into_iter() .filter(|db| { @@ -150,6 +242,7 @@ impl AsyncSystemTable for DatabasesTable { .ok() .and_then(|ownership| ownership.map(|o| o.role.clone())), ); + dropped_on.push(db.get_db_info().meta.drop_on.map(|v| v.timestamp_micros())); } } } @@ -159,11 +252,14 @@ impl AsyncSystemTable for DatabasesTable { StringType::from_data(db_names), UInt64Type::from_data(db_ids), StringType::from_opt_data(owners), + TimestampType::from_opt_data(dropped_on), ])) } } -impl DatabasesTable { +impl DatabasesTable +where DatabasesTable: HistoryAware +{ pub fn create(table_id: u64) -> Arc { let schema = TableSchemaRefExt::create(vec![ TableField::new("catalog", TableDataType::String), @@ -173,11 +269,16 @@ impl DatabasesTable { "owner", TableDataType::Nullable(Box::from(TableDataType::String)), ), + TableField::new( + "dropped_on", + TableDataType::Nullable(Box::new(TableDataType::Timestamp)), + ), ]); + let name = Self::TABLE_NAME; let table_info = TableInfo { - desc: "'system'.'databases'".to_string(), - name: "databases".to_string(), + desc: format!("'system'.'{name}'"), + name: Self::NAME.to_owned(), ident: TableIdent::new(table_id, 0), meta: TableMeta { schema, diff --git a/src/query/storages/system/src/lib.rs b/src/query/storages/system/src/lib.rs index 21210b47148f..8b067b9232e0 100644 --- a/src/query/storages/system/src/lib.rs +++ b/src/query/storages/system/src/lib.rs @@ -84,6 +84,8 @@ pub use configs_table::ConfigsTable; pub use contributors_table::ContributorsTable; pub use credits_table::CreditsTable; pub use databases_table::DatabasesTable; +pub use databases_table::DatabasesTableWithHistory; +pub use databases_table::DatabasesTableWithoutHistory; pub use dictionaries_table::DictionariesTable; pub use engines_table::EnginesTable; pub use functions_table::FunctionsTable; diff --git a/tests/sqllogictests/suites/base/06_show/06_0009_show_databases.test b/tests/sqllogictests/suites/base/06_show/06_0009_show_databases.test index c19550335bba..55ac566855e2 100644 --- a/tests/sqllogictests/suites/base/06_show/06_0009_show_databases.test +++ b/tests/sqllogictests/suites/base/06_show/06_0009_show_databases.test @@ -38,3 +38,8 @@ DROP DATABASE IF EXISTS ss1 statement ok DROP DATABASE IF EXISTS ss2 + +query T +select name, dropped_on is not null from system.databases_with_history where name='ss1' order by dropped_on limit 1; +---- +ss1 1 diff --git a/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.result b/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.result index 1ff68e3a1f7b..c96959197bde 100644 --- a/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.result +++ b/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.result @@ -1,6 +1,10 @@ === test u1 with role1 === information_schema system +true true +db1 true +system +information_schema 1 Error: APIError: ResponseError with 1063: Permission denied: privilege [Select] is required on 'default'.'db_root'.'t1' for user 'u1'@'%' with roles [public,role1] db1 diff --git a/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.sh b/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.sh index ff8970bbfba9..9d0869d9fd99 100755 --- a/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.sh +++ b/tests/suites/0_stateless/18_rbac/18_0003_db_visibility.sh @@ -33,6 +33,12 @@ echo "grant role role1 to u1;" | $BENDSQL_CLIENT_CONNECT export TEST_U1_CONNECT="bendsql --user=u1 --password=123 --host=${QUERY_MYSQL_HANDLER_HOST} --port ${QUERY_HTTP_HANDLER_PORT}" echo "show databases" | $TEST_U1_CONNECT echo "create database db1;" | $TEST_U1_CONNECT +echo "grant delete on db1.* to u1" | $BENDSQL_CLIENT_CONNECT +echo "drop database db1;" | $TEST_U1_CONNECT +echo "select count(name)>0, count(dropped_on is not null)>0 from system.databases_with_history where name='db1'" | $BENDSQL_CLIENT_CONNECT +echo "select name, dropped_on is not null from system.databases_with_history where name='db1'" | $TEST_U1_CONNECT +echo "select name from system.databases_with_history where name!='db1'" | $TEST_U1_CONNECT +echo "create database db1;" | $TEST_U1_CONNECT echo "create table db1.t1(id int);" | $TEST_U1_CONNECT echo "insert into db1.t1 values(1);" | $TEST_U1_CONNECT echo "select * from db1.t1;" | $TEST_U1_CONNECT From 9af8ba3381492726f072041d579b09a02aa184fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Wed, 13 Nov 2024 15:03:52 +0800 Subject: [PATCH 3/5] refactor: align metrics field names with current behavior (#16826) - Rename `db_size` to `raft_log_size`, which is the size of on-disk data of raft-log. - Rename `key_num` to `snapshot_key_count`. This commit updates field names in - the the metrics API, - and the cluster status gRPC API. --- src/meta/binaries/metactl/main.rs | 4 +-- src/meta/service/src/api/grpc/grpc_service.rs | 4 +-- .../service/src/meta_service/meta_node.rs | 19 +++++++------ .../src/meta_service/meta_node_status.rs | 8 +++--- src/meta/service/src/metrics/meta_metrics.rs | 28 +++++++++++-------- src/meta/service/src/store/store_inner.rs | 2 +- src/meta/types/proto/meta.proto | 4 +-- 7 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/meta/binaries/metactl/main.rs b/src/meta/binaries/metactl/main.rs index 04b9aee59816..bffe0aae683c 100644 --- a/src/meta/binaries/metactl/main.rs +++ b/src/meta/binaries/metactl/main.rs @@ -236,8 +236,8 @@ impl App { let res = client.get_cluster_status().await?; println!("BinaryVersion: {}", res.binary_version); println!("DataVersion: {}", res.data_version); - println!("DBSize: {}", res.db_size); - println!("KeyNumber: {}", res.key_num); + println!("RaftLogSize: {}", res.raft_log_size); + println!("SnapshotKeyCount: {}", res.snapshot_key_count); println!("Node: id={} raft={}", res.id, res.endpoint); println!("State: {}", res.state); if let Some(leader) = res.leader { diff --git a/src/meta/service/src/api/grpc/grpc_service.rs b/src/meta/service/src/api/grpc/grpc_service.rs index a10e3171032c..1ca6b2e458ef 100644 --- a/src/meta/service/src/api/grpc/grpc_service.rs +++ b/src/meta/service/src/api/grpc/grpc_service.rs @@ -462,8 +462,8 @@ impl MetaService for MetaServiceImpl { binary_version: status.binary_version, data_version: status.data_version.to_string(), endpoint: status.endpoint, - db_size: status.db_size, - key_num: status.key_num as u64, + raft_log_size: status.raft_log_size, + snapshot_key_count: status.snapshot_key_count as u64, state: status.state, is_leader: status.is_leader, current_term: status.current_term, diff --git a/src/meta/service/src/meta_service/meta_node.rs b/src/meta/service/src/meta_service/meta_node.rs index 81c5d33dca7d..02ea28e34208 100644 --- a/src/meta/service/src/meta_service/meta_node.rs +++ b/src/meta/service/src/meta_service/meta_node.rs @@ -447,8 +447,8 @@ impl MetaNode { server_metrics::set_last_seq(meta_node.get_last_seq().await); // metrics about server storage - server_metrics::set_db_size(meta_node.get_db_size().await); - server_metrics::set_snapshot_key_num(meta_node.get_key_num().await); + server_metrics::set_raft_log_size(meta_node.get_raft_log_size().await); + server_metrics::set_snapshot_key_count(meta_node.get_snapshot_key_count().await); last_leader = mm.current_leader; } @@ -817,13 +817,14 @@ impl MetaNode { nodes } - async fn get_db_size(&self) -> u64 { + /// Get the size in bytes of the on disk files of the raft log storage. + async fn get_raft_log_size(&self) -> u64 { self.sto.log.read().await.on_disk_size() } - async fn get_key_num(&self) -> u64 { + async fn get_snapshot_key_count(&self) -> u64 { self.sto - .try_get_snapshot_key_num() + .try_get_snapshot_key_count() .await .unwrap_or_default() } @@ -841,8 +842,8 @@ impl MetaNode { let endpoint = self.sto.get_node_raft_endpoint(&self.sto.id).await?; - let db_size = self.get_db_size().await; - let key_num = self.get_key_num().await; + let raft_log_size = self.get_raft_log_size().await; + let key_count = self.get_snapshot_key_count().await; let metrics = self.raft.metrics().borrow().clone(); @@ -859,8 +860,8 @@ impl MetaNode { binary_version: METASRV_COMMIT_VERSION.as_str().to_string(), data_version: DATA_VERSION, endpoint: endpoint.to_string(), - db_size, - key_num, + raft_log_size, + snapshot_key_count: key_count, state: format!("{:?}", metrics.state), is_leader: metrics.state == openraft::ServerState::Leader, current_term: metrics.current_term, diff --git a/src/meta/service/src/meta_service/meta_node_status.rs b/src/meta/service/src/meta_service/meta_node_status.rs index 73c084fb77b5..cd995fb3784f 100644 --- a/src/meta/service/src/meta_service/meta_node_status.rs +++ b/src/meta/service/src/meta_service/meta_node_status.rs @@ -32,11 +32,11 @@ pub struct MetaNodeStatus { /// The raft service endpoint for internal communication pub endpoint: String, - /// The size in bytes of the on disk data. - pub db_size: u64, + /// The size in bytes of the raft-log on disk data. + pub raft_log_size: u64, - /// key number of current snapshot - pub key_num: u64, + /// Total number of keys in current snapshot + pub snapshot_key_count: u64, /// Server state, one of "Follower", "Learner", "Candidate", "Leader". pub state: String, diff --git a/src/meta/service/src/metrics/meta_metrics.rs b/src/meta/service/src/metrics/meta_metrics.rs index 6698b0385657..022cb1f5c832 100644 --- a/src/meta/service/src/metrics/meta_metrics.rs +++ b/src/meta/service/src/metrics/meta_metrics.rs @@ -52,8 +52,8 @@ pub mod server_metrics { node_is_health: Gauge, leader_changes: Counter, applying_snapshot: Gauge, - snapshot_key_num: Gauge, - db_size: Gauge, + snapshot_key_count: Gauge, + raft_log_size: Gauge, last_log_index: Gauge, last_seq: Gauge, current_term: Gauge, @@ -73,8 +73,8 @@ pub mod server_metrics { node_is_health: Gauge::default(), leader_changes: Counter::default(), applying_snapshot: Gauge::default(), - snapshot_key_num: Gauge::default(), - db_size: Gauge::default(), + snapshot_key_count: Gauge::default(), + raft_log_size: Gauge::default(), last_log_index: Gauge::default(), last_seq: Gauge::default(), current_term: Gauge::default(), @@ -109,11 +109,15 @@ pub mod server_metrics { metrics.applying_snapshot.clone(), ); registry.register( - key!("snapshot_key_num"), - "snapshot key numbers", - metrics.snapshot_key_num.clone(), + key!("snapshot_key_count"), + "number of keys in the last snapshot", + metrics.snapshot_key_count.clone(), + ); + registry.register( + key!("raft_log_size"), + "the size in bytes of the on disk data of raft log", + metrics.raft_log_size.clone(), ); - registry.register(key!("db_size"), "db size", metrics.db_size.clone()); registry.register( key!("proposals_applied"), "proposals applied", @@ -174,12 +178,12 @@ pub mod server_metrics { SERVER_METRICS.applying_snapshot.inc_by(cnt); } - pub fn set_snapshot_key_num(snapshot_key_num: u64) { - SERVER_METRICS.snapshot_key_num.set(snapshot_key_num as i64); + pub fn set_snapshot_key_count(n: u64) { + SERVER_METRICS.snapshot_key_count.set(n as i64); } - pub fn set_db_size(db_size: u64) { - SERVER_METRICS.db_size.set(db_size as i64); + pub fn set_raft_log_size(raft_log_size: u64) { + SERVER_METRICS.raft_log_size.set(raft_log_size as i64); } pub fn set_proposals_applied(proposals_applied: u64) { diff --git a/src/meta/service/src/store/store_inner.rs b/src/meta/service/src/store/store_inner.rs index 7ba4b33c24f2..2d39defc66fc 100644 --- a/src/meta/service/src/store/store_inner.rs +++ b/src/meta/service/src/store/store_inner.rs @@ -292,7 +292,7 @@ impl StoreInner { /// Return snapshot id and meta of the last snapshot. /// /// It returns None if there is no snapshot or there is an error parsing snapshot meta or id. - pub(crate) async fn try_get_snapshot_key_num(&self) -> Option { + pub(crate) async fn try_get_snapshot_key_count(&self) -> Option { let sm = self.state_machine.read().await; let db = sm.levels().persisted()?; Some(db.stat().key_num) diff --git a/src/meta/types/proto/meta.proto b/src/meta/types/proto/meta.proto index 03fc08f222cf..ab3a304e3aae 100644 --- a/src/meta/types/proto/meta.proto +++ b/src/meta/types/proto/meta.proto @@ -167,7 +167,7 @@ message ClusterStatus { string binary_version = 2; string data_version = 3; string endpoint = 4; - uint64 db_size = 5; + uint64 raft_log_size = 5; string state = 6; bool is_leader = 7; uint64 current_term = 8; @@ -180,7 +180,7 @@ message ClusterStatus { repeated string voters = 15; repeated string non_voters = 16; uint64 last_seq = 17; - uint64 key_num = 18; + uint64 snapshot_key_count = 18; } message ClientInfo { From 80c8cf69fff42521deb4d78e6e26f1320f161754 Mon Sep 17 00:00:00 2001 From: Bohu Date: Wed, 13 Nov 2024 16:35:58 +0800 Subject: [PATCH 4/5] feat: uuid function from v4 to v7 (#16827) --- Cargo.toml | 2 +- src/query/functions/src/scalars/other.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 94a00b803105..04088ab2da64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -485,7 +485,7 @@ typetag = "0.2.3" unicode-segmentation = "1.10.1" unindent = "0.2" url = "2.3.1" -uuid = { version = "1.10.0", features = ["serde", "v4", "v7"] } +uuid = { version = "1.10.0", features = ["std", "serde", "v4", "v7"] } volo-thrift = "0.10" walkdir = "2.3.2" wiremock = "0.6" diff --git a/src/query/functions/src/scalars/other.rs b/src/query/functions/src/scalars/other.rs index 0dd6f34ec2e2..1904b40aa9a7 100644 --- a/src/query/functions/src/scalars/other.rs +++ b/src/query/functions/src/scalars/other.rs @@ -234,7 +234,7 @@ pub fn register(registry: &mut FunctionRegistry) { let mut builder = BinaryColumnBuilder::with_capacity(ctx.num_rows, 0); for _ in 0..ctx.num_rows { - let value = Uuid::new_v4(); + let value = Uuid::now_v7(); write!(&mut builder.data, "{}", value).unwrap(); builder.commit_row(); } From 872627c6185b8f597890bafbaf47841c88fce5b2 Mon Sep 17 00:00:00 2001 From: coldWater Date: Wed, 13 Nov 2024 19:17:41 +0800 Subject: [PATCH 5/5] feat: refine the rule `PushDownFilterWindowTopN` in case top n is equal to 0. (#16830) * top n 0 Signed-off-by: coldWater * test Signed-off-by: coldWater * rename Signed-off-by: coldWater * fix Signed-off-by: coldWater --------- Signed-off-by: coldWater --- .../sql/src/planner/optimizer/rule/factory.rs | 4 ++- .../rule_push_down_filter_window_top_n.rs | 30 +++++++++++++++++-- .../sql/src/planner/optimizer/rule/rule.rs | 6 ++-- .../mode/standalone/explain/window.test | 10 ++++++- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/query/sql/src/planner/optimizer/rule/factory.rs b/src/query/sql/src/planner/optimizer/rule/factory.rs index 50ab1ed44ef9..0aa1fd27b4ff 100644 --- a/src/query/sql/src/planner/optimizer/rule/factory.rs +++ b/src/query/sql/src/planner/optimizer/rule/factory.rs @@ -92,7 +92,9 @@ impl RuleFactory { } RuleID::PushDownFilterAggregate => Ok(Box::new(RulePushDownFilterAggregate::new())), RuleID::PushDownFilterWindow => Ok(Box::new(RulePushDownFilterWindow::new())), - RuleID::PushDownFilterWindowRank => Ok(Box::new(RulePushDownFilterWindowTopN::new())), + RuleID::PushDownFilterWindowTopN => { + Ok(Box::new(RulePushDownFilterWindowTopN::new(ctx.metadata))) + } RuleID::EliminateFilter => Ok(Box::new(RuleEliminateFilter::new(ctx.metadata))), RuleID::MergeEvalScalar => Ok(Box::new(RuleMergeEvalScalar::new())), RuleID::MergeFilter => Ok(Box::new(RuleMergeFilter::new())), diff --git a/src/query/sql/src/planner/optimizer/rule/rewrite/rule_push_down_filter_window_top_n.rs b/src/query/sql/src/planner/optimizer/rule/rewrite/rule_push_down_filter_window_top_n.rs index 136aa8622076..981f722ee884 100644 --- a/src/query/sql/src/planner/optimizer/rule/rewrite/rule_push_down_filter_window_top_n.rs +++ b/src/query/sql/src/planner/optimizer/rule/rewrite/rule_push_down_filter_window_top_n.rs @@ -16,21 +16,28 @@ use std::sync::Arc; use databend_common_exception::Result; use databend_common_expression::type_check::check_number; +use databend_common_expression::DataField; +use databend_common_expression::DataSchemaRefExt; use databend_common_expression::FunctionContext; use databend_common_functions::BUILTIN_FUNCTIONS; use crate::optimizer::extract::Matcher; use crate::optimizer::rule::Rule; use crate::optimizer::rule::TransformResult; +use crate::optimizer::RelExpr; use crate::optimizer::RuleID; use crate::optimizer::SExpr; use crate::plans::ComparisonOp; +use crate::plans::ConstantTableScan; use crate::plans::Filter; +use crate::plans::Operator; use crate::plans::RelOp; +use crate::plans::RelOperator; use crate::plans::ScalarExpr; use crate::plans::Sort; use crate::plans::Window; use crate::plans::WindowFuncType; +use crate::MetadataRef; /// Input: Filter /// \ @@ -45,13 +52,15 @@ use crate::plans::WindowFuncType; /// Sort(top n) pub struct RulePushDownFilterWindowTopN { id: RuleID, + metadata: MetadataRef, matchers: Vec, } impl RulePushDownFilterWindowTopN { - pub fn new() -> Self { + pub fn new(metadata: MetadataRef) -> Self { Self { - id: RuleID::PushDownFilterWindowRank, + id: RuleID::PushDownFilterWindowTopN, + metadata, matchers: vec![Matcher::MatchOp { op_type: RelOp::Filter, children: vec![Matcher::MatchOp { @@ -93,7 +102,22 @@ impl Rule for RulePushDownFilterWindowTopN { }; if top_n == 0 { - // TODO + let output_columns = s_expr + .plan() + .derive_relational_prop(&RelExpr::with_s_expr(s_expr))? + .output_columns + .clone(); + let metadata = self.metadata.read(); + let mut columns = output_columns.iter().copied().collect::>(); + columns.sort(); + let fields = columns + .into_iter() + .map(|col| DataField::new(&col.to_string(), metadata.column(col).data_type())) + .collect::>(); + let empty_scan = + ConstantTableScan::new_empty_scan(DataSchemaRefExt::create(fields), output_columns); + let result = SExpr::create_leaf(Arc::new(RelOperator::ConstantTableScan(empty_scan))); + state.add_result(result); return Ok(()); } diff --git a/src/query/sql/src/planner/optimizer/rule/rule.rs b/src/query/sql/src/planner/optimizer/rule/rule.rs index f13a67a6b5a5..7ea8ec9ea591 100644 --- a/src/query/sql/src/planner/optimizer/rule/rule.rs +++ b/src/query/sql/src/planner/optimizer/rule/rule.rs @@ -37,7 +37,7 @@ pub static DEFAULT_REWRITE_RULES: LazyLock> = LazyLock::new(|| { RuleID::PushDownFilterUnion, RuleID::PushDownFilterAggregate, RuleID::PushDownFilterWindow, - RuleID::PushDownFilterWindowRank, + RuleID::PushDownFilterWindowTopN, RuleID::PushDownFilterSort, RuleID::PushDownFilterEvalScalar, RuleID::PushDownFilterJoin, @@ -91,7 +91,7 @@ pub enum RuleID { PushDownFilterSort, PushDownFilterProjectSet, PushDownFilterWindow, - PushDownFilterWindowRank, + PushDownFilterWindowTopN, PushDownLimit, PushDownLimitUnion, PushDownLimitOuterJoin, @@ -142,7 +142,7 @@ impl Display for RuleID { RuleID::PushDownSortEvalScalar => write!(f, "PushDownSortEvalScalar"), RuleID::PushDownLimitWindow => write!(f, "PushDownLimitWindow"), RuleID::PushDownFilterWindow => write!(f, "PushDownFilterWindow"), - RuleID::PushDownFilterWindowRank => write!(f, "PushDownFilterWindowRank"), + RuleID::PushDownFilterWindowTopN => write!(f, "PushDownFilterWindowTopN"), RuleID::EliminateEvalScalar => write!(f, "EliminateEvalScalar"), RuleID::EliminateFilter => write!(f, "EliminateFilter"), RuleID::EliminateSort => write!(f, "EliminateSort"), diff --git a/tests/sqllogictests/suites/mode/standalone/explain/window.test b/tests/sqllogictests/suites/mode/standalone/explain/window.test index 37044436493e..454ab3efd904 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/window.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/window.test @@ -541,9 +541,17 @@ CompoundBlockOperator(Project) × 1 SyncReadParquetDataTransform × 1 BlockPartitionSource × 1 +# top n 0 +query T +explain optimized select time, rowkey from (select *, row_number() over(partition by rowkey order by time desc) as rn from table43764_orc) a where rn < 1 +---- +EvalScalar +├── scalars: [a.rowkey (#0) AS (#0), table43764_orc.rowkey (#0) AS (#0), a.time (#1) AS (#1), table43764_orc.time (#1) AS (#1), table43764_orc.sirc_action (#2) AS (#2), table43764_orc.sirc_operation_count (#3) AS (#3), table43764_orc.akc087 (#4) AS (#4), table43764_orc.aae035 (#5) AS (#5), row_number() OVER ( PARTITION BY rowkey ORDER BY time DESC ) (#6) AS (#6), a.rn (#6) AS (#7)] +└── EmptyResultScan + # same order multi window query T -explain pipeline select *,lead(number,1, 42) over (order by number), lead(number,2,44) over (order by number), lead(number,3,44) over (order by number) from numbers(5); +explain pipeline select *,lead(number,1, 42) over (order by number), lead(number,2,44) over (order by number), lead(number,3,44) over (order by number) from numbers(5); ---- CompoundBlockOperator(Project) × 1 Transform Window × 1