mirror of https://github.com/citusdata/citus.git
indent
parent
f49caf8aca
commit
128a259b15
|
@ -136,8 +136,7 @@ static MultiNode * ApplyCartesianProductReferenceJoin(MultiNode *leftNode,
|
||||||
static MultiNode * ApplyCartesianProduct(MultiNode *leftNode, MultiNode *rightNode,
|
static MultiNode * ApplyCartesianProduct(MultiNode *leftNode, MultiNode *rightNode,
|
||||||
List *partitionColumnList, JoinType joinType,
|
List *partitionColumnList, JoinType joinType,
|
||||||
List *joinClauses);
|
List *joinClauses);
|
||||||
static bool
|
static bool ExprMentionsPartitionColumn(Node *node, Query *query);
|
||||||
ExprMentionsPartitionColumn(Node *node, Query *query);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -233,7 +232,8 @@ TargetListOnPartitionColumn(Query *query, List *targetEntryList)
|
||||||
RangeTblEntry *rte = NULL;
|
RangeTblEntry *rte = NULL;
|
||||||
|
|
||||||
FindReferencedTableColumn(targetExpression, NIL, query, &column, &rte,
|
FindReferencedTableColumn(targetExpression, NIL, query, &column, &rte,
|
||||||
/*skipOuterVars=*/false);
|
|
||||||
|
/*skipOuterVars=*/ false);
|
||||||
Oid relationId = rte ? rte->relid : InvalidOid;
|
Oid relationId = rte ? rte->relid : InvalidOid;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -308,7 +308,9 @@ static bool
|
||||||
ExprMentionsPartitionColumn(Node *node, Query *query)
|
ExprMentionsPartitionColumn(Node *node, Query *query)
|
||||||
{
|
{
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsA(node, Var))
|
if (IsA(node, Var))
|
||||||
{
|
{
|
||||||
|
@ -323,21 +325,27 @@ ExprMentionsPartitionColumn(Node *node, Query *query)
|
||||||
|
|
||||||
/* Sanity-check varno */
|
/* Sanity-check varno */
|
||||||
if (v->varno <= 0 || v->varno > list_length(query->rtable))
|
if (v->varno <= 0 || v->varno > list_length(query->rtable))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
RangeTblEntry *rte = rt_fetch(v->varno, query->rtable);
|
RangeTblEntry *rte = rt_fetch(v->varno, query->rtable);
|
||||||
|
|
||||||
#if PG_VERSION_NUM >= 180000
|
#if PG_VERSION_NUM >= 180000
|
||||||
|
|
||||||
/* Synthetic GROUP RTE – examine its expressions instead */
|
/* Synthetic GROUP RTE – examine its expressions instead */
|
||||||
if (rte->rtekind == RTE_GROUP && rte->groupexprs)
|
if (rte->rtekind == RTE_GROUP && rte->groupexprs)
|
||||||
{
|
{
|
||||||
ListCell *lc;
|
ListCell *lc;
|
||||||
foreach (lc, rte->groupexprs)
|
foreach(lc, rte->groupexprs)
|
||||||
if (ExprMentionsPartitionColumn((Node *) lfirst(lc), query))
|
if (ExprMentionsPartitionColumn((Node *) lfirst(lc), query))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Real table? — compare against its dist key */
|
/* Real table? — compare against its dist key */
|
||||||
if (rte->rtekind == RTE_RELATION && HasDistributionKey(rte->relid))
|
if (rte->rtekind == RTE_RELATION && HasDistributionKey(rte->relid))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue