mirror of https://github.com/citusdata/citus.git
Refactor
parent
ad089f3dbb
commit
9574ebc988
|
@ -83,6 +83,7 @@ static void EnsureSequentialModeForFunctionDDL(void);
|
||||||
static bool ShouldPropagateCreateFunction(CreateFunctionStmt *stmt);
|
static bool ShouldPropagateCreateFunction(CreateFunctionStmt *stmt);
|
||||||
static bool ShouldPropagateAlterFunction(const ObjectAddress *address);
|
static bool ShouldPropagateAlterFunction(const ObjectAddress *address);
|
||||||
static bool ShouldAddFunctionSignature(FunctionParameterMode mode);
|
static bool ShouldAddFunctionSignature(FunctionParameterMode mode);
|
||||||
|
static bool DependentRelationsOfFunctionCanBeDistributed(ObjectAddress *functionAddress);
|
||||||
static ObjectAddress FunctionToObjectAddress(ObjectType objectType,
|
static ObjectAddress FunctionToObjectAddress(ObjectType objectType,
|
||||||
ObjectWithArgs *objectWithArgs,
|
ObjectWithArgs *objectWithArgs,
|
||||||
bool missing_ok);
|
bool missing_ok);
|
||||||
|
@ -1310,9 +1311,10 @@ PreprocessCreateFunctionStmt(Node *node, const char *queryString,
|
||||||
* PostprocessCreateFunctionStmt actually creates the plan we need to execute for function
|
* PostprocessCreateFunctionStmt actually creates the plan we need to execute for function
|
||||||
* propagation. This is the downside of using pg_get_functiondef to get the sql statement.
|
* propagation. This is the downside of using pg_get_functiondef to get the sql statement.
|
||||||
*
|
*
|
||||||
* If function depends on any non-distributed table or sequence, Citus can not distribute
|
* If function depends on any non-distributed relation (except sequence and composite type),
|
||||||
* it. In order to not to prevent users from creating local functions on the coordinator
|
* Citus can not distribute it. In order to not to prevent users from creating local
|
||||||
* WARNING message will be sent to the customer about the case instead of erroring out.
|
* functions on the coordinator WARNING message will be sent to the customer about the case
|
||||||
|
* instead of erroring out.
|
||||||
*
|
*
|
||||||
* Besides creating the plan we also make sure all (new) dependencies of the function are
|
* Besides creating the plan we also make sure all (new) dependencies of the function are
|
||||||
* created on all nodes.
|
* created on all nodes.
|
||||||
|
@ -1352,7 +1354,7 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString)
|
||||||
* DependentRelationsOfFunctionCanBeDistributed checks whether Citus can distribute
|
* DependentRelationsOfFunctionCanBeDistributed checks whether Citus can distribute
|
||||||
* dependent relations of the given function.
|
* dependent relations of the given function.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
DependentRelationsOfFunctionCanBeDistributed(ObjectAddress *functionAddress)
|
DependentRelationsOfFunctionCanBeDistributed(ObjectAddress *functionAddress)
|
||||||
{
|
{
|
||||||
Assert(getObjectClass(functionAddress) == OCLASS_PROC);
|
Assert(getObjectClass(functionAddress) == OCLASS_PROC);
|
||||||
|
|
|
@ -259,7 +259,6 @@ extern List * PreprocessCreateFunctionStmt(Node *stmt, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext);
|
||||||
extern List * PostprocessCreateFunctionStmt(Node *stmt,
|
extern List * PostprocessCreateFunctionStmt(Node *stmt,
|
||||||
const char *queryString);
|
const char *queryString);
|
||||||
extern bool DependentRelationsOfFunctionCanBeDistributed(ObjectAddress *functionAddress);
|
|
||||||
extern ObjectAddress CreateFunctionStmtObjectAddress(Node *stmt,
|
extern ObjectAddress CreateFunctionStmtObjectAddress(Node *stmt,
|
||||||
bool missing_ok);
|
bool missing_ok);
|
||||||
extern ObjectAddress DefineAggregateStmtObjectAddress(Node *stmt,
|
extern ObjectAddress DefineAggregateStmtObjectAddress(Node *stmt,
|
||||||
|
|
Loading…
Reference in New Issue