Merge pull request #63788 from ClickHouse/show-create-system-tables

Use right comments for system tables
This commit is contained in:
Alexey Milovidov 2024-06-08 06:34:04 +02:00 committed by GitHub
commit 873964b882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 67 additions and 67 deletions

View File

@ -267,7 +267,7 @@ For introspection use `system.s3queue` stateless table and `system.s3queue_log`
`exception` String
)
ENGINE = SystemS3Queue
COMMENT 'SYSTEM TABLE is built on the fly.' │
COMMENT 'Contains in-memory state of S3Queue metadata and currently processed rows per file.' │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

View File

@ -794,7 +794,7 @@ ASTPtr DatabaseOnDisk::getCreateQueryFromStorage(const String & table_name, cons
throw_on_error);
create_table_query->set(create_table_query->as<ASTCreateQuery>()->comment,
std::make_shared<ASTLiteral>("SYSTEM TABLE is built on the fly."));
std::make_shared<ASTLiteral>(storage->getInMemoryMetadata().comment));
return create_table_query;
}

View File

@ -4,7 +4,7 @@ CREATE TABLE system.aggregate_function_combinators
`is_internal` UInt8
)
ENGINE = SystemAggregateFunctionCombinators
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available aggregate function combinators, which could be applied to aggregate functions and change the way they work.'
CREATE TABLE system.asynchronous_inserts
(
`query` String,
@ -17,7 +17,7 @@ CREATE TABLE system.asynchronous_inserts
`entries.bytes` Array(UInt64)
)
ENGINE = SystemAsynchronousInserts
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about pending asynchronous inserts in queue in server\'s memory.'
CREATE TABLE system.asynchronous_metrics
(
`metric` String,
@ -25,14 +25,14 @@ CREATE TABLE system.asynchronous_metrics
`description` String
)
ENGINE = SystemAsynchronousMetrics
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains metrics that are calculated periodically in the background. For example, the amount of RAM in use.'
CREATE TABLE system.build_options
(
`name` String,
`value` String
)
ENGINE = SystemBuildOptions
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all build flags, compiler options and commit hash for used build.'
CREATE TABLE system.clusters
(
`cluster` String,
@ -55,14 +55,14 @@ CREATE TABLE system.clusters
`name` String ALIAS cluster
)
ENGINE = SystemClusters
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about clusters defined in the configuration file or generated by a Replicated database.'
CREATE TABLE system.collations
(
`name` String,
`language` Nullable(String)
)
ENGINE = SystemTableCollations
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available collations for alphabetical comparison of strings.'
CREATE TABLE system.columns
(
`database` String,
@ -88,13 +88,13 @@ CREATE TABLE system.columns
`datetime_precision` Nullable(UInt64)
)
ENGINE = SystemColumns
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Lists all columns from all tables of the current server.'
CREATE TABLE system.contributors
(
`name` String
)
ENGINE = SystemContributors
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all ClickHouse contributors <3'
CREATE TABLE system.current_roles
(
`role_name` String,
@ -102,7 +102,7 @@ CREATE TABLE system.current_roles
`is_default` UInt8
)
ENGINE = SystemCurrentRoles
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains active roles of a current user. SET ROLE changes the contents of this table.'
CREATE TABLE system.data_skipping_indices
(
`database` String,
@ -117,7 +117,7 @@ CREATE TABLE system.data_skipping_indices
`marks` UInt64
)
ENGINE = SystemDataSkippingIndices
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains all the information about all the data skipping indices in tables, similar to system.columns.'
CREATE TABLE system.data_type_families
(
`name` String,
@ -125,7 +125,7 @@ CREATE TABLE system.data_type_families
`alias_to` String
)
ENGINE = SystemTableDataTypeFamilies
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available native data types along with all the aliases used for compatibility with other DBMS.'
CREATE TABLE system.databases
(
`name` String,
@ -138,7 +138,7 @@ CREATE TABLE system.databases
`database` String ALIAS name
)
ENGINE = SystemDatabases
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Lists all databases of the current server.'
CREATE TABLE system.detached_parts
(
`database` String,
@ -155,7 +155,7 @@ CREATE TABLE system.detached_parts
`level` Nullable(UInt32)
)
ENGINE = SystemDetachedParts
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all parts which are being found in /detached directory along with a reason why it was detached. ClickHouse server doesn\'t use such parts anyhow.'
CREATE TABLE system.dictionaries
(
`database` String,
@ -185,7 +185,7 @@ CREATE TABLE system.dictionaries
`comment` String
)
ENGINE = SystemDictionaries
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about dictionaries.'
CREATE TABLE system.disks
(
`name` String,
@ -205,7 +205,7 @@ CREATE TABLE system.disks
`cache_path` String
)
ENGINE = SystemDisks
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about disks defined in the server configuration.'
CREATE TABLE system.distributed_ddl_queue
(
`entry` String,
@ -225,7 +225,7 @@ CREATE TABLE system.distributed_ddl_queue
`query_duration_ms` Nullable(UInt64)
)
ENGINE = SystemDDLWorkerQueue
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about distributed DDL queries (ON CLUSTER clause) that were executed on a cluster.'
CREATE TABLE system.distribution_queue
(
`database` String,
@ -241,7 +241,7 @@ CREATE TABLE system.distribution_queue
`last_exception_time` DateTime
)
ENGINE = SystemDistributionQueue
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about local files that are in the queue to be sent to the shards. These local files contain new parts that are created by inserting new data into the Distributed table in asynchronous mode.'
CREATE TABLE system.enabled_roles
(
`role_name` String,
@ -250,7 +250,7 @@ CREATE TABLE system.enabled_roles
`is_default` UInt8
)
ENGINE = SystemEnabledRoles
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains all active roles at the moment, including current role of the current user and granted roles for current role.'
CREATE TABLE system.errors
(
`name` String,
@ -262,7 +262,7 @@ CREATE TABLE system.errors
`remote` UInt8
)
ENGINE = SystemErrors
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all errors which have ever happened including the error code, last time and message with unsymbolized stacktrace.'
CREATE TABLE system.events
(
`event` String,
@ -271,7 +271,7 @@ CREATE TABLE system.events
`name` String ALIAS event
)
ENGINE = SystemEvents
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains profiling events and their current value.'
CREATE TABLE system.formats
(
`name` String,
@ -281,7 +281,7 @@ CREATE TABLE system.formats
`supports_parallel_formatting` UInt8
)
ENGINE = SystemFormats
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all the formats along with flags whether a format is suitable for input/output or whether it supports parallelization.'
CREATE TABLE system.functions
(
`name` String,
@ -299,7 +299,7 @@ CREATE TABLE system.functions
`categories` String
)
ENGINE = SystemFunctions
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available ordinary and aggregate functions with their descriptions.'
CREATE TABLE system.graphite_retentions
(
`config_name` String,
@ -314,7 +314,7 @@ CREATE TABLE system.graphite_retentions
`Tables.table` Array(String)
)
ENGINE = SystemGraphite
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about parameters graphite_rollup which are used in tables with *GraphiteMergeTree engines.'
CREATE TABLE system.licenses
(
`library_name` String,
@ -323,14 +323,14 @@ CREATE TABLE system.licenses
`license_text` String
)
ENGINE = SystemLicenses
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains licenses of third-party libraries that are located in the contrib directory of ClickHouse sources.'
CREATE TABLE system.macros
(
`macro` String,
`substitution` String
)
ENGINE = SystemMacros
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all macros defined in server configuration.'
CREATE TABLE system.merge_tree_settings
(
`name` String,
@ -344,7 +344,7 @@ CREATE TABLE system.merge_tree_settings
`is_obsolete` UInt8
)
ENGINE = SystemMergeTreeSettings
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all MergeTree engine specific settings, their current and default values along with descriptions. You may change any of them in SETTINGS section in CREATE query.'
CREATE TABLE system.merges
(
`database` String,
@ -373,7 +373,7 @@ CREATE TABLE system.merges
`merge_algorithm` String
)
ENGINE = SystemMerges
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of merges currently executing merges of MergeTree tables and their progress. Each merge operation is represented by a single row.'
CREATE TABLE system.metrics
(
`metric` String,
@ -382,7 +382,7 @@ CREATE TABLE system.metrics
`name` String ALIAS metric
)
ENGINE = SystemMetrics
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains metrics which can be calculated instantly, or have a current value. For example, the number of simultaneously processed queries or the current replica delay. This table is always up to date.'
CREATE TABLE system.moves
(
`database` String,
@ -395,7 +395,7 @@ CREATE TABLE system.moves
`thread_id` UInt64
)
ENGINE = SystemMoves
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about in-progress data part moves of MergeTree tables. Each data part movement is represented by a single row.'
CREATE TABLE system.mutations
(
`database` String,
@ -414,25 +414,25 @@ CREATE TABLE system.mutations
`latest_fail_reason` String
)
ENGINE = SystemMutations
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of mutations and their progress. Each mutation command is represented by a single row.'
CREATE TABLE system.numbers
(
`number` UInt64
)
ENGINE = SystemNumbers
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Generates all natural numbers, starting from 0 (to 2^64 - 1, and then again) in sorted order.'
CREATE TABLE system.numbers_mt
(
`number` UInt64
)
ENGINE = SystemNumbers
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Multithreaded version of `system.numbers`. Numbers order is not guaranteed.'
CREATE TABLE system.one
(
`dummy` UInt8
)
ENGINE = SystemOne
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'This table contains a single row with a single dummy UInt8 column containing the value 0. Used when the table is not specified explicitly, for example in queries like `SELECT 1`.'
CREATE TABLE system.part_moves_between_shards
(
`database` String,
@ -451,7 +451,7 @@ CREATE TABLE system.part_moves_between_shards
`last_exception` String
)
ENGINE = SystemShardMoves
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about parts which are currently in a process of moving between shards and their progress.'
CREATE TABLE system.parts
(
`partition` String,
@ -522,7 +522,7 @@ CREATE TABLE system.parts
`part_name` String ALIAS name
)
ENGINE = SystemParts
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of currently existing (both active and inactive) parts of all *-MergeTree tables. Each part is represented by a single row.'
CREATE TABLE system.parts_columns
(
`partition` String,
@ -582,7 +582,7 @@ CREATE TABLE system.parts_columns
`part_name` String ALIAS name
)
ENGINE = SystemPartsColumns
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of columns of all currently existing parts of all MergeTree tables. Each column is represented by a single row.'
CREATE TABLE system.processes
(
`is_initial_query` UInt8,
@ -630,7 +630,7 @@ CREATE TABLE system.processes
`Settings.Values` Array(String) ALIAS mapValues(Settings)
)
ENGINE = SystemProcesses
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of currently executing processes (queries) with their progress.'
CREATE TABLE system.projection_parts
(
`partition` String,
@ -698,7 +698,7 @@ CREATE TABLE system.projection_parts
`part_name` String ALIAS name
)
ENGINE = SystemProjectionParts
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of currently existing projection parts (a copy of some part containing aggregated data or just sorted in different order) created for all the projections for all tables within a cluster.'
CREATE TABLE system.projection_parts_columns
(
`partition` String,
@ -754,7 +754,7 @@ CREATE TABLE system.projection_parts_columns
`part_name` String ALIAS name
)
ENGINE = SystemProjectionPartsColumns
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of columns of all currently existing projection parts of all MergeTree tables. Each column is represented by a single row.'
CREATE TABLE system.quota_limits
(
`quota_name` String,
@ -773,7 +773,7 @@ CREATE TABLE system.quota_limits
`max_failed_sequential_authentications` Nullable(UInt64)
)
ENGINE = SystemQuotaLimits
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about maximums for all intervals of all quotas. Any number of rows or zero can correspond to specific quota.'
CREATE TABLE system.quota_usage
(
`quota_name` String,
@ -805,7 +805,7 @@ CREATE TABLE system.quota_usage
`max_failed_sequential_authentications` Nullable(UInt64)
)
ENGINE = SystemQuotaUsage
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains quota usage by the current user: how much is used and how much is left.'
CREATE TABLE system.quotas
(
`name` String,
@ -818,7 +818,7 @@ CREATE TABLE system.quotas
`apply_to_except` Array(String)
)
ENGINE = SystemQuotas
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about quotas.'
CREATE TABLE system.quotas_usage
(
`quota_name` String,
@ -851,7 +851,7 @@ CREATE TABLE system.quotas_usage
`max_failed_sequential_authentications` Nullable(UInt64)
)
ENGINE = SystemQuotasUsage
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains quota usage by all users.'
CREATE TABLE system.replicas
(
`database` String,
@ -891,7 +891,7 @@ CREATE TABLE system.replicas
`replica_is_active` Map(String, UInt8)
)
ENGINE = SystemReplicas
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information and status of all table replicas on current server. Each replica is represented by a single row.'
CREATE TABLE system.replicated_fetches
(
`database` String,
@ -912,7 +912,7 @@ CREATE TABLE system.replicated_fetches
`thread_id` UInt64
)
ENGINE = SystemReplicatedFetches
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about currently running background fetches.'
CREATE TABLE system.replicated_merge_tree_settings
(
`name` String,
@ -926,7 +926,7 @@ CREATE TABLE system.replicated_merge_tree_settings
`is_obsolete` UInt8
)
ENGINE = SystemReplicatedMergeTreeSettings
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all ReplicatedMergeTree engine specific settings, their current and default values along with descriptions. You may change any of them in SETTINGS section in CREATE query. '
CREATE TABLE system.replication_queue
(
`database` String,
@ -952,7 +952,7 @@ CREATE TABLE system.replication_queue
`merge_type` String
)
ENGINE = SystemReplicationQueue
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about tasks from replication queues stored in ClickHouse Keeper, or ZooKeeper, for each table replica.'
CREATE TABLE system.role_grants
(
`user_name` Nullable(String),
@ -963,7 +963,7 @@ CREATE TABLE system.role_grants
`with_admin_option` UInt8
)
ENGINE = SystemRoleGrants
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains the role grants for users and roles. To add entries to this table, use `GRANT role TO user`. Using this table you may find out which roles are assigned to which users or which roles a user has.'
CREATE TABLE system.roles
(
`name` String,
@ -971,7 +971,7 @@ CREATE TABLE system.roles
`storage` String
)
ENGINE = SystemRoles
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all roles created at the server.'
CREATE TABLE system.row_policies
(
`name` String,
@ -987,7 +987,7 @@ CREATE TABLE system.row_policies
`apply_to_except` Array(String)
)
ENGINE = SystemRowPolicies
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains filters for one particular table, as well as a list of roles and/or users which should use this row policy.'
CREATE TABLE system.settings
(
`name` String,
@ -1003,7 +1003,7 @@ CREATE TABLE system.settings
`is_obsolete` UInt8
)
ENGINE = SystemSettings
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all user-level settings (which can be modified in a scope of query or session), their current and default values along with descriptions.'
CREATE TABLE system.settings_profile_elements
(
`profile_name` Nullable(String),
@ -1018,7 +1018,7 @@ CREATE TABLE system.settings_profile_elements
`inherit_profile` Nullable(String)
)
ENGINE = SystemSettingsProfileElements
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Describes the content of each settings profile configured on the server. Including settings constraints, roles and users for which the settings are applied, and parent settings profiles.'
CREATE TABLE system.settings_profiles
(
`name` String,
@ -1030,7 +1030,7 @@ CREATE TABLE system.settings_profiles
`apply_to_except` Array(String)
)
ENGINE = SystemSettingsProfiles
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains properties of configured setting profiles.'
CREATE TABLE system.stack_trace
(
`thread_name` String,
@ -1039,7 +1039,7 @@ CREATE TABLE system.stack_trace
`trace` Array(UInt64)
)
ENGINE = SystemStackTrace
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Allows to obtain an unsymbolized stacktrace from all the threads of the server process.'
CREATE TABLE system.storage_policies
(
`policy_name` String,
@ -1054,7 +1054,7 @@ CREATE TABLE system.storage_policies
`load_balancing` Enum8('ROUND_ROBIN' = 0, 'LEAST_USED' = 1)
)
ENGINE = SystemStoragePolicies
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains information about storage policies and volumes defined in the server configuration.'
CREATE TABLE system.table_engines
(
`name` String,
@ -1068,7 +1068,7 @@ CREATE TABLE system.table_engines
`supports_parallel_insert` UInt8
)
ENGINE = SystemTableEngines
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available table engines along with information whether a particular table engine supports some specific features (e.g. settings, skipping indices, projections, replication, TTL, deduplication, parallel insert, etc.)'
CREATE TABLE system.table_functions
(
`name` String,
@ -1076,7 +1076,7 @@ CREATE TABLE system.table_functions
`allow_readonly` UInt8
)
ENGINE = SystemTableFunctions
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all available table functions with their descriptions.'
CREATE TABLE system.tables
(
`database` String,
@ -1115,13 +1115,13 @@ CREATE TABLE system.tables
`table` String ALIAS name
)
ENGINE = SystemTables
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Lists all tables of the current server.'
CREATE TABLE system.time_zones
(
`time_zone` String
)
ENGINE = SystemTimeZones
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of time zones that are supported by the ClickHouse server. This list of timezones might vary depending on the version of ClickHouse.'
CREATE TABLE system.user_directories
(
`name` String,
@ -1130,7 +1130,7 @@ CREATE TABLE system.user_directories
`precedence` UInt64
)
ENGINE = SystemUserDirectories
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains the information about configured user directories - directories on the file system from which ClickHouse server is allowed to read user provided data.'
CREATE TABLE system.users
(
`name` String,
@ -1151,22 +1151,22 @@ CREATE TABLE system.users
`default_database` String
)
ENGINE = SystemUsers
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains a list of all users profiles either configured at the server through a configuration file or created via SQL.'
CREATE TABLE system.warnings
(
`message` String
)
ENGINE = SystemWarnings
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Contains warnings about server configuration to be displayed by clickhouse-client right after it connects to the server.'
CREATE TABLE system.zeros
(
`zero` UInt8
)
ENGINE = SystemZeros
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Produces unlimited number of non-materialized zeros.'
CREATE TABLE system.zeros_mt
(
`zero` UInt8
)
ENGINE = SystemZeros
COMMENT 'SYSTEM TABLE is built on the fly.'
COMMENT 'Multithreaded version of system.zeros.'

View File

@ -1 +1 @@
CREATE TABLE system.rocksdb\n(\n `database` String,\n `table` String,\n `name` String,\n `value` UInt64\n)\nENGINE = SystemRocksDB\nCOMMENT \'SYSTEM TABLE is built on the fly.\'
CREATE TABLE system.rocksdb\n(\n `database` String,\n `table` String,\n `name` String,\n `value` UInt64\n)\nENGINE = SystemRocksDB\nCOMMENT \'Contains a list of metrics exposed from embedded RocksDB.\'