diff --git a/src/catalog/src/system_schema/information_schema/columns.rs b/src/catalog/src/system_schema/information_schema/columns.rs index df39e75e98..2550661120 100644 --- a/src/catalog/src/system_schema/information_schema/columns.rs +++ b/src/catalog/src/system_schema/information_schema/columns.rs @@ -399,8 +399,8 @@ impl InformationSchemaColumnsBuilder { self.is_nullables.push(Some("No")); } self.column_types.push(Some(&data_type)); - self.column_comments - .push(column_schema.column_comment().map(|x| x.as_ref())); + let column_comment = column_schema.column_comment().map(|x| x.as_ref()); + self.column_comments.push(column_comment); } fn finish(&mut self) -> Result { diff --git a/src/query/src/dist_plan/commutativity.rs b/src/query/src/dist_plan/commutativity.rs index f8b3b18f1c..91aa909622 100644 --- a/src/query/src/dist_plan/commutativity.rs +++ b/src/query/src/dist_plan/commutativity.rs @@ -144,7 +144,7 @@ impl Categorizer { } } // all group by expressions are partition columns can push down, unless - // another push down(including `Limit` or `Sort`) is already in progress(which will then prvent next cond commutative node from being push down). + // another push down(including `Limit` or `Sort`) is already in progress(which will then prevent next cond commutative node from being push down). // TODO(discord9): This is a temporary solution(that works), a better description of // commutativity is needed under this situation. Commutativity::ConditionalCommutative(None) diff --git a/src/query/src/query_engine/state.rs b/src/query/src/query_engine/state.rs index d232c0367d..4a2e6dc67d 100644 --- a/src/query/src/query_engine/state.rs +++ b/src/query/src/query_engine/state.rs @@ -234,7 +234,7 @@ impl QueryEngineState { rules.retain(|rule| rule.name() != name); } - /// Optimize the logical plan by the extension anayzer rules. + /// Optimize the logical plan by the extension analyzer rules. pub fn optimize_by_extension_rules( &self, plan: DfLogicalPlan, diff --git a/tests/cases/standalone/common/comment.result b/tests/cases/standalone/common/comment.result index 19f9b8776b..9da9541977 100644 --- a/tests/cases/standalone/common/comment.result +++ b/tests/cases/standalone/common/comment.result @@ -32,6 +32,17 @@ SHOW CREATE TABLE comment_table_test; | | ) | +--------------------+---------------------------------------------------+ +SELECT table_comment +FROM information_schema.tables +WHERE table_schema = 'public' + AND table_name = 'comment_table_test'; + ++-------------------------+ +| table_comment | ++-------------------------+ +| table level description | ++-------------------------+ + -- Remove table comment COMMENT ON TABLE comment_table_test IS NULL; @@ -54,6 +65,17 @@ SHOW CREATE TABLE comment_table_test; | | | +--------------------+---------------------------------------------------+ +SELECT table_comment +FROM information_schema.tables +WHERE table_schema = 'public' + AND table_name = 'comment_table_test'; + ++---------------+ +| table_comment | ++---------------+ +| | ++---------------+ + DROP TABLE comment_table_test; Affected Rows: 0 @@ -90,6 +112,18 @@ SHOW CREATE TABLE comment_column_test; | | | +---------------------+---------------------------------------------------------+ +SELECT column_comment +FROM information_schema.columns +WHERE table_schema = 'public' + AND table_name = 'comment_column_test' + AND column_name = 'val'; + ++--------------------------+ +| column_comment | ++--------------------------+ +| value column description | ++--------------------------+ + -- Remove column comment COMMENT ON COLUMN comment_column_test.val IS NULL; @@ -112,6 +146,18 @@ SHOW CREATE TABLE comment_column_test; | | | +---------------------+----------------------------------------------------+ +SELECT column_comment +FROM information_schema.columns +WHERE table_schema = 'public' + AND table_name = 'comment_column_test' + AND column_name = 'val'; + ++----------------+ +| column_comment | ++----------------+ +| | ++----------------+ + DROP TABLE comment_column_test; Affected Rows: 0 @@ -155,6 +201,16 @@ SHOW CREATE FLOW flow_comment_test; | | AS SELECT desc_str, ts FROM flow_source_comment_test | +-------------------+------------------------------------------------------+ +SELECT comment +FROM information_schema.flows +WHERE flow_name = 'flow_comment_test'; + ++------------------------+ +| comment | ++------------------------+ +| flow level description | ++------------------------+ + -- Remove flow comment COMMENT ON FLOW flow_comment_test IS NULL; @@ -170,6 +226,16 @@ SHOW CREATE FLOW flow_comment_test; | | AS SELECT desc_str, ts FROM flow_source_comment_test | +-------------------+------------------------------------------------------+ +SELECT comment +FROM information_schema.flows +WHERE flow_name = 'flow_comment_test'; + ++---------+ +| comment | ++---------+ +| | ++---------+ + DROP FLOW flow_comment_test; Affected Rows: 0 diff --git a/tests/cases/standalone/common/comment.sql b/tests/cases/standalone/common/comment.sql index 564480563b..d64f11e32a 100644 --- a/tests/cases/standalone/common/comment.sql +++ b/tests/cases/standalone/common/comment.sql @@ -9,10 +9,18 @@ CREATE TABLE comment_table_test ( -- Add table comment COMMENT ON TABLE comment_table_test IS 'table level description'; SHOW CREATE TABLE comment_table_test; +SELECT table_comment +FROM information_schema.tables +WHERE table_schema = 'public' + AND table_name = 'comment_table_test'; -- Remove table comment COMMENT ON TABLE comment_table_test IS NULL; SHOW CREATE TABLE comment_table_test; +SELECT table_comment +FROM information_schema.tables +WHERE table_schema = 'public' + AND table_name = 'comment_table_test'; DROP TABLE comment_table_test; @@ -27,10 +35,20 @@ CREATE TABLE comment_column_test ( -- Add column comment COMMENT ON COLUMN comment_column_test.val IS 'value column description'; SHOW CREATE TABLE comment_column_test; +SELECT column_comment +FROM information_schema.columns +WHERE table_schema = 'public' + AND table_name = 'comment_column_test' + AND column_name = 'val'; -- Remove column comment COMMENT ON COLUMN comment_column_test.val IS NULL; SHOW CREATE TABLE comment_column_test; +SELECT column_comment +FROM information_schema.columns +WHERE table_schema = 'public' + AND table_name = 'comment_column_test' + AND column_name = 'val'; DROP TABLE comment_column_test; @@ -54,12 +72,17 @@ 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; +SELECT comment +FROM information_schema.flows +WHERE flow_name = 'flow_comment_test'; -- Remove flow comment COMMENT ON FLOW flow_comment_test IS NULL; SHOW CREATE FLOW flow_comment_test; +SELECT comment +FROM information_schema.flows +WHERE flow_name = 'flow_comment_test'; DROP FLOW flow_comment_test; DROP TABLE flow_source_comment_test; DROP TABLE flow_sink_comment_test; -