StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.71k stars 1.75k forks source link

support user defined comments for catalog #50825

Open shawn0915 opened 2 weeks ago

shawn0915 commented 2 weeks ago

Feature request

Is your feature request related to a problem? Please describe.

创建catalog:

StarRocks> CREATE EXTERNAL CATALOG mysql_catalog
    -> PROPERTIES
    -> (
    ->     "type"="JDBC",
    ->     "user"="root",
    ->     "password"="root",
    ->     "jdbc_uri"="jdbc:mysql://localhost:3306",
    ->     "driver_url"="file:///tmp/mysql-connector-java-8.0.30.jar",
    ->     "driver_class"="com.mysql.cj.jdbc.Driver",
    -> "Comment"="MySQL Catalog"
    -> );
Query OK, 0 rows affected (0.02 sec)

但是不支持自定义 comment?

StarRocks> SHOW CATALOGS;
+-----------------+----------+------------------------------------------------------------------+
| Catalog         | Type     | Comment                                                          |
+-----------------+----------+------------------------------------------------------------------+
| default_catalog | Internal | An internal catalog contains this cluster's self-managed tables. |
| mysql_catalog   | JDBC     | NULL                                                             |
+-----------------+----------+------------------------------------------------------------------+
2 rows in set (0.00 sec)

Describe the solution you'd like

Describe alternatives you've considered

Additional context

danielhumanmod commented 2 weeks ago

Hi @shawn0915 , I can take a look and support this feature

danielhumanmod commented 1 week ago

Hi @shawn0915 , you can add user defined comment directly by CREATE EXTERNAL CATALOG [catalog_name] COMMENT [custom_comment] instead of putting them in properties.

The full syntax is: (Reference)

CREATE EXTERNAL CATALOG [IF NOT EXISTS] <catalog_name>
[COMMENT <comment>]
PROPERTIES ("key"="value", ...)