mirror of https://github.com/citusdata/citus.git
Fix typo: aggragate -> aggregate
parent
863bf49507
commit
bf7d86a3e8
|
@ -206,7 +206,7 @@ static Expr * AddTypeConversion(Node *originalAggregate, Node *newExpression);
|
||||||
static MultiExtendedOp * WorkerExtendedOpNode(MultiExtendedOp *originalOpNode,
|
static MultiExtendedOp * WorkerExtendedOpNode(MultiExtendedOp *originalOpNode,
|
||||||
ExtendedOpNodeProperties *
|
ExtendedOpNodeProperties *
|
||||||
extendedOpNodeProperties);
|
extendedOpNodeProperties);
|
||||||
static bool TargetListHasAggragates(List *targetEntryList);
|
static bool TargetListHasAggregates(List *targetEntryList);
|
||||||
static void ProcessTargetListForWorkerQuery(List *targetEntryList,
|
static void ProcessTargetListForWorkerQuery(List *targetEntryList,
|
||||||
ExtendedOpNodeProperties *
|
ExtendedOpNodeProperties *
|
||||||
extendedOpNodeProperties,
|
extendedOpNodeProperties,
|
||||||
|
@ -2176,7 +2176,7 @@ WorkerExtendedOpNode(MultiExtendedOp *originalOpNode,
|
||||||
bool hasDistinctOn = originalOpNode->hasDistinctOn;
|
bool hasDistinctOn = originalOpNode->hasDistinctOn;
|
||||||
|
|
||||||
int originalGroupClauseLength = list_length(originalGroupClauseList);
|
int originalGroupClauseLength = list_length(originalGroupClauseList);
|
||||||
bool queryHasAggregates = TargetListHasAggragates(originalTargetEntryList);
|
bool queryHasAggregates = TargetListHasAggregates(originalTargetEntryList);
|
||||||
|
|
||||||
/* initialize to default values */
|
/* initialize to default values */
|
||||||
memset(&queryTargetList, 0, sizeof(queryTargetList));
|
memset(&queryTargetList, 0, sizeof(queryTargetList));
|
||||||
|
@ -2288,7 +2288,7 @@ WorkerExtendedOpNode(MultiExtendedOp *originalOpNode,
|
||||||
* the worker with two expressions count() and sum(). Thus, a single target entry
|
* the worker with two expressions count() and sum(). Thus, a single target entry
|
||||||
* might end up with multiple expressions in the worker query.
|
* might end up with multiple expressions in the worker query.
|
||||||
*
|
*
|
||||||
* The function doesn't change the aggragates in the window functions and sends them
|
* The function doesn't change the aggregates in the window functions and sends them
|
||||||
* as-is. The reason is that Citus currently only supports pushing down window
|
* as-is. The reason is that Citus currently only supports pushing down window
|
||||||
* functions as-is. As we implement pull-to-master window functions, we should
|
* functions as-is. As we implement pull-to-master window functions, we should
|
||||||
* revisit here as well.
|
* revisit here as well.
|
||||||
|
@ -2519,9 +2519,9 @@ ProcessDistinctClauseForWorkerQuery(List *distinctClause, bool hasDistinctOn,
|
||||||
* Note that even though Citus only pushes down the window functions, it may need to
|
* Note that even though Citus only pushes down the window functions, it may need to
|
||||||
* modify the target list of the worker query when the window function refers to
|
* modify the target list of the worker query when the window function refers to
|
||||||
* an avg(). The reason is that any aggregate which is also referred by other
|
* an avg(). The reason is that any aggregate which is also referred by other
|
||||||
* target entries would be mutated by Citus. Thus, we add a copy of the same aggragate
|
* target entries would be mutated by Citus. Thus, we add a copy of the same aggregate
|
||||||
* to the worker target list to make sure that the window function refers to the
|
* to the worker target list to make sure that the window function refers to the
|
||||||
* non-mutated aggragate.
|
* non-mutated aggregate.
|
||||||
*
|
*
|
||||||
* inputs: windowClauseList, originalTargetEntryList
|
* inputs: windowClauseList, originalTargetEntryList
|
||||||
* outputs: queryWindowClause, queryTargetList
|
* outputs: queryWindowClause, queryTargetList
|
||||||
|
@ -2563,8 +2563,8 @@ ProcessWindowFunctionsForWorkerQuery(List *windowClauseList,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note that even Citus does push down the window clauses as-is, we may still need to
|
* Note that even Citus does push down the window clauses as-is, we may still need to
|
||||||
* add the generated entries to the target list. The reason is that the same aggragates
|
* add the generated entries to the target list. The reason is that the same aggregates
|
||||||
* might be referred from another target entry that is a bare aggragate (e.g., no window
|
* might be referred from another target entry that is a bare aggregate (e.g., no window
|
||||||
* functions), which would have been mutated. For instance, when an average aggregate
|
* functions), which would have been mutated. For instance, when an average aggregate
|
||||||
* is mutated on the target list, the window function would refer to a sum aggregate,
|
* is mutated on the target list, the window function would refer to a sum aggregate,
|
||||||
* which is obviously wrong.
|
* which is obviously wrong.
|
||||||
|
@ -2651,11 +2651,11 @@ BuildOrderByLimitReference(bool hasDistinctOn, bool groupedByDisjointPartitionCo
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TargetListHasAggragates returns true if any of the elements in the
|
* TargetListHasAggregates returns true if any of the elements in the
|
||||||
* target list contain aggragates that are not inside the window functions.
|
* target list contain aggregates that are not inside the window functions.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
TargetListHasAggragates(List *targetEntryList)
|
TargetListHasAggregates(List *targetEntryList)
|
||||||
{
|
{
|
||||||
ListCell *targetEntryCell = NULL;
|
ListCell *targetEntryCell = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1330,7 +1330,7 @@ CREATE TEMP TABLE temp_articles_hash_mx as
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
DETAIL: distribution column value: 1
|
DETAIL: distribution column value: 1
|
||||||
-- router plannable queries may include filter for aggragates
|
-- router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -2178,7 +2178,7 @@ CREATE TEMP TABLE temp_articles_hash as
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
DETAIL: distribution column value: 1
|
DETAIL: distribution column value: 1
|
||||||
-- router plannable queries may include filter for aggragates
|
-- router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -1470,7 +1470,7 @@ DEBUG: Distributed planning for a fast-path router query
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
DETAIL: distribution column value: 1
|
DETAIL: distribution column value: 1
|
||||||
-- fast-path router plannable queries may include filter for aggragates
|
-- fast-path router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -263,7 +263,7 @@ ORDER BY
|
||||||
LIMIT 10;
|
LIMIT 10;
|
||||||
ERROR: could not run distributed query because the window function that is used cannot be pushed down
|
ERROR: could not run distributed query because the window function that is used cannot be pushed down
|
||||||
HINT: Window functions are supported in two ways. Either add an equality filter on the distributed tables' partition column or use the window functions with a PARTITION BY clause containing the distribution column
|
HINT: Window functions are supported in two ways. Either add an equality filter on the distributed tables' partition column or use the window functions with a PARTITION BY clause containing the distribution column
|
||||||
-- ORDER BY in the window function is an aggragate
|
-- ORDER BY in the window function is an aggregate
|
||||||
SELECT
|
SELECT
|
||||||
user_id, rank() OVER my_win as rnk, avg(value_2) as avg_val_2
|
user_id, rank() OVER my_win as rnk, avg(value_2) as avg_val_2
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -569,7 +569,7 @@ CREATE TEMP TABLE temp_articles_hash_mx as
|
||||||
WHERE author_id = 1
|
WHERE author_id = 1
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
|
|
||||||
-- router plannable queries may include filter for aggragates
|
-- router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -1016,7 +1016,7 @@ CREATE TEMP TABLE temp_articles_hash as
|
||||||
WHERE author_id = 1
|
WHERE author_id = 1
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
|
|
||||||
-- router plannable queries may include filter for aggragates
|
-- router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -635,7 +635,7 @@ CREATE TEMP TABLE temp_articles_hash as
|
||||||
WHERE author_id = 1
|
WHERE author_id = 1
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
|
|
||||||
-- fast-path router plannable queries may include filter for aggragates
|
-- fast-path router plannable queries may include filter for aggregates
|
||||||
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
SELECT count(*), count(*) FILTER (WHERE id < 3)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1;
|
WHERE author_id = 1;
|
||||||
|
|
|
@ -150,7 +150,7 @@ ORDER BY
|
||||||
rnk DESC, 1 DESC
|
rnk DESC, 1 DESC
|
||||||
LIMIT 10;
|
LIMIT 10;
|
||||||
|
|
||||||
-- ORDER BY in the window function is an aggragate
|
-- ORDER BY in the window function is an aggregate
|
||||||
SELECT
|
SELECT
|
||||||
user_id, rank() OVER my_win as rnk, avg(value_2) as avg_val_2
|
user_id, rank() OVER my_win as rnk, avg(value_2) as avg_val_2
|
||||||
FROM
|
FROM
|
||||||
|
|
Loading…
Reference in New Issue