Skip to content

Commit

Permalink
Rename ContainsOnlyLocalTables to ContainsOnlyLocalOrReferenceTables …
Browse files Browse the repository at this point in the history
…for clarity and update related documentation
  • Loading branch information
m3hm3t committed Feb 12, 2025
1 parent d9eb9dd commit e1b8b66
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/backend/distributed/planner/merge_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ IsLocalTableModification(Oid targetRelationId, Query *query, uint64 shardId,
return true;
}

if (shardId == INVALID_SHARD_ID && ContainsOnlyLocalTables(rteProperties))
if (shardId == INVALID_SHARD_ID && ContainsOnlyLocalOrReferenceTables(rteProperties))
{
return true;
}
Expand Down
10 changes: 6 additions & 4 deletions src/backend/distributed/planner/multi_router_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -2556,13 +2556,15 @@ AllShardsColocated(List *relationShardList)


/*
* ContainsOnlyLocalTables returns true if there is only
* local tables and not any distributed or reference table.
* ContainsOnlyLocalOrReferenceTables returns true if there are no distributed
* tables in the query. In other words, the query might reference only local
* tables and/or reference tables, but no fully distributed tables.
*/
bool
ContainsOnlyLocalTables(RTEListProperties *rteProperties)
ContainsOnlyLocalOrReferenceTables(RTEListProperties *rteProperties)
{
return !rteProperties->hasDistributedTable;
// If hasDistributedTable is false, then all tables are either local or reference.
return !rteProperties->hasDistributedTable;
}


Expand Down
2 changes: 1 addition & 1 deletion src/include/distributed/multi_router_planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extern bool HasDangerousJoinUsing(List *rtableList, Node *jtnode);
extern Job * RouterJob(Query *originalQuery,
PlannerRestrictionContext *plannerRestrictionContext,
DeferredErrorMessage **planningError);
extern bool ContainsOnlyLocalTables(RTEListProperties *rteProperties);
extern bool ContainsOnlyLocalOrReferenceTables(RTEListProperties *rteProperties);
extern RangeTblEntry * ExtractSourceResultRangeTableEntry(Query *query);

#endif /* MULTI_ROUTER_PLANNER_H */
2 changes: 1 addition & 1 deletion src/test/regress/multi_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test: multi_dropped_column_aliases foreign_key_restriction_enforcement
test: binary_protocol
test: alter_table_set_access_method
test: alter_distributed_table
test: issue_5248 issue_5099 issue_5763 issue_6543 issue_6758 issue_7477 issue_7705
test: issue_5248 issue_5099 issue_5763 issue_6543 issue_6758 issue_7477 issue_7705 issue_7891
test: object_propagation_debug
test: undistribute_table
test: run_command_on_all_nodes
Expand Down

0 comments on commit e1b8b66

Please sign in to comment.