Files
greptimedb/tests/cases/standalone/common/comment.sql
Ruihang Xia 564cc0c750 feat: table/column/flow COMMENT (#7060)
* initial impl

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* simplify impl

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* sqlness test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* avoid unimplemented panic

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* validate flow

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix table column comment

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* table level comment

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* simplify table info serde

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* don't txn

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* remove empty trait

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* wip: procedure

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update proto

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* grpc support

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* Apply suggestions from code review

Co-authored-by: dennis zhuang <killme2008@gmail.com>
Co-authored-by: LFC <990479+MichaelScofield@users.noreply.github.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* try from pb struct

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* doc comment

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* check unchanged fast case

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* tune errors

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix merge error

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* use try_as_raw_value

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: dennis zhuang <killme2008@gmail.com>
Co-authored-by: LFC <990479+MichaelScofield@users.noreply.github.com>
2025-12-10 15:08:47 +00:00

66 lines
1.5 KiB
SQL

-- Test: COMMENT ON TABLE add & remove
CREATE TABLE comment_table_test (
pk INT,
val DOUBLE,
ts TIMESTAMP TIME INDEX,
PRIMARY KEY(pk)
);
-- Add table comment
COMMENT ON TABLE comment_table_test IS 'table level description';
SHOW CREATE TABLE comment_table_test;
-- Remove table comment
COMMENT ON TABLE comment_table_test IS NULL;
SHOW CREATE TABLE comment_table_test;
DROP TABLE comment_table_test;
-- Test: COMMENT ON COLUMN add & remove
CREATE TABLE comment_column_test (
pk INT,
val DOUBLE,
ts TIMESTAMP TIME INDEX,
PRIMARY KEY(pk)
);
-- Add column comment
COMMENT ON COLUMN comment_column_test.val IS 'value column description';
SHOW CREATE TABLE comment_column_test;
-- Remove column comment
COMMENT ON COLUMN comment_column_test.val IS NULL;
SHOW CREATE TABLE comment_column_test;
DROP TABLE comment_column_test;
-- Test: COMMENT ON FLOW add & remove
-- Prepare source & sink tables
CREATE TABLE flow_source_comment_test (
desc_str STRING,
ts TIMESTAMP TIME INDEX
);
CREATE TABLE flow_sink_comment_test (
desc_str STRING,
ts TIMESTAMP TIME INDEX
);
CREATE FLOW flow_comment_test
SINK TO flow_sink_comment_test
AS
SELECT desc_str, ts FROM flow_source_comment_test;
-- Add flow comment
COMMENT ON FLOW flow_comment_test IS 'flow level description';
SHOW CREATE FLOW flow_comment_test;
-- Remove flow comment
COMMENT ON FLOW flow_comment_test IS NULL;
SHOW CREATE FLOW flow_comment_test;
DROP FLOW flow_comment_test;
DROP TABLE flow_source_comment_test;
DROP TABLE flow_sink_comment_test;