Skip to content

Commit

Permalink
Clean some typos about IVM (#825)
Browse files Browse the repository at this point in the history
No code changes. Just clean some typos about IVM‘s comments.
Parts of typos are from pg_ivm.
  • Loading branch information
hyongtao-db authored Dec 31, 2024
1 parent 976e4c8 commit 47fe6d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/backend/commands/createas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ check_ivm_restriction_walker(Node *node, check_ivm_restriction_context *context)
if (qry->havingQual != NULL)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg(" HAVING clause is not supported on incrementally maintainable materialized view")));
errmsg("HAVING clause is not supported on incrementally maintainable materialized view")));
if (qry->sortClause != NIL) /* There is a possibility that we don't need to return an error */
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
Expand Down
28 changes: 14 additions & 14 deletions src/backend/commands/matview.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,

/*
* Fast path to REFRESH a view:
* avoid do the real REFRESH if the data of view
* avoid doing the real REFRESH if the data of view
* is up to date. The data should be the logically same as after
* REFRESH when there is data changed since latest REFRESH.
* In that case we may save a lot, ex: a cron task REFRESH view periodically
Expand Down Expand Up @@ -772,17 +772,17 @@ refresh_matview_datafill(DestReceiver *dest, Query *query,

/*
* Cloudberry specific behavior:
* MPP architecture need to make sure OIDs of the temp table are the same
* MPP architecture needs to make sure OIDs of the temp table are the same
* among QD and all QEs. It stores the OID in the static variable dispatch_oids.
* This variable will be consumed for each dispatch.
*
* During planning, Cloudberry might pre-evalute some function expr, this will
* lead to dispatch if the function is in SQL or PLPGSQL and consume the above
* lead to dispatch if the function is in SQL or PLPGSQL and consumes the above
* static variable. So later refresh matview's dispatch will not find the
* oid on QEs.
*
* We first store the OIDs information in a local variable, and then restore
* it for later refresh matview's dispatch to solve the above issue.
* it is for later refresh matview's dispatch to solve the above issue.
*
* See Github Issue for details: https://github.com/greenplum-db/gpdb/issues/11956
*/
Expand Down Expand Up @@ -2897,7 +2897,7 @@ get_operation_string(IvmOp op, const char *col, const char *arg1, const char *ar
* get_null_condition_string
*
* Build a predicate string for CASE clause to check if an aggregate value
* will became NULL after the given operation is applied.
* will become NULL after the given operation is applied.
*/
static char *
get_null_condition_string(IvmOp op, const char *arg1, const char *arg2,
Expand Down Expand Up @@ -2933,12 +2933,12 @@ get_null_condition_string(IvmOp op, const char *arg1, const char *arg2,
/*
* apply_old_delta_with_count
*
* Execute a query for applying a delta table given by deltname_old
* which contains tuples to be deleted from to a materialized view given by
* Execute a query for applying a delta table given by deltaname_old
* which contains tuples to be deleted from a materialized view given by
* matviewname. This is used when counting is required, that is, the view
* has aggregate or distinct.
*
* If the view desn't have aggregates or has GROUP BY, this requires a keys
* If the view doesn't have aggregates or has GROUP BY, this requires a keys
* list to identify a tuple in the view. If the view has aggregates, this
* requires strings representing resnames of aggregates and SET clause for
* updating aggregate values.
Expand Down Expand Up @@ -3047,8 +3047,8 @@ apply_old_delta_with_count(const char *matviewname, Oid matviewRelid, const char
/*
* apply_old_delta
*
* Execute a query for applying a delta table given by deltname_old
* which contains tuples to be deleted from to a materialized view given by
* Execute a query for applying a delta table given by deltaname_old
* which contains tuples to be deleted from a materialized view given by
* matviewname. This is used when counting is not required.
*/
static void
Expand Down Expand Up @@ -3097,13 +3097,13 @@ apply_old_delta(const char *matviewname, const char *deltaname_old,
/*
* apply_new_delta_with_count
*
* Execute a query for applying a delta table given by deltname_new
* Execute a query for applying a delta table given by deltaname_new
* which contains tuples to be inserted into a materialized view given by
* matviewname. This is used when counting is required, that is, the view
* has aggregate or distinct. Also, when a table in EXISTS sub queries
* is modified.
*
* If the view desn't have aggregates or has GROUP BY, this requires a keys
* If the view doesn't have aggregates or has GROUP BY, this requires a keys
* list to identify a tuple in the view. If the view has aggregates, this
* requires strings representing SET clause for updating aggregate values.
*/
Expand Down Expand Up @@ -3188,7 +3188,7 @@ apply_new_delta_with_count(const char *matviewname, const char* deltaname_new,
/*
* apply_new_delta
*
* Execute a query for applying a delta table given by deltname_new
* Execute a query for applying a delta table given by deltaname_new
* which contains tuples to be inserted into a materialized view given by
* matviewname. This is used when counting is not required.
*/
Expand Down Expand Up @@ -3458,7 +3458,7 @@ clean_up_ivm_dsm_entry(MV_TriggerHashEntry *entry)
/*
* isIvmName
*
* Check if this is a IVM hidden column from the name.
* Check if this is an IVM hidden column from the name.
*/
bool
isIvmName(const char *s)
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/incremental_matview.out
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ CREATE INCREMENTAL MATERIALIZED VIEW mv_ivm07 AS SELECT i,j,k FROM mv_base_a a I
ERROR: ORDER BY clause is not supported on incrementally maintainable materialized view
-- contain HAVING
CREATE INCREMENTAL MATERIALIZED VIEW mv_ivm08 AS SELECT i,j,k FROM mv_base_a a INNER JOIN mv_base_b b USING(i) GROUP BY i,j,k HAVING SUM(i) > 5;
ERROR: HAVING clause is not supported on incrementally maintainable materialized view
ERROR: HAVING clause is not supported on incrementally maintainable materialized view
-- contain view or materialized view
CREATE VIEW b_view AS SELECT i,k FROM mv_base_b;
CREATE MATERIALIZED VIEW b_mview AS SELECT i,k FROM mv_base_b;
Expand Down

0 comments on commit 47fe6d9

Please sign in to comment.