mirror of https://github.com/citusdata/citus.git
Let RTE_RESULT pass through, extract_grouping_collations
parent
0528bba907
commit
b9bb4388d3
|
@ -357,12 +357,13 @@ BuildAggregatePlan(Query *masterQuery, Plan *subPlan)
|
|||
}
|
||||
|
||||
/* finally create the plan */
|
||||
/* TODO no nulls */
|
||||
aggregatePlan = make_aggCompat(aggregateTargetList, (List *) havingQual,
|
||||
aggregateStrategy,
|
||||
AGGSPLIT_SIMPLE, groupColumnCount, groupColumnIdArray,
|
||||
groupColumnOpArray, NULL, NIL, NIL,
|
||||
rowEstimate, subPlan);
|
||||
groupColumnOpArray,
|
||||
extract_grouping_collations(groupColumnList,
|
||||
subPlan->targetlist),
|
||||
NIL, NIL, rowEstimate, subPlan);
|
||||
|
||||
/* just for reproducible costs between different PostgreSQL versions */
|
||||
aggregatePlan->plan.startup_cost = 0;
|
||||
|
@ -532,13 +533,14 @@ BuildDistinctPlan(Query *masterQuery, Plan *subPlan)
|
|||
Oid *distinctColumnOpArray = extract_grouping_ops(distinctClauseList);
|
||||
uint32 distinctClauseCount = list_length(distinctClauseList);
|
||||
|
||||
/* TODO no nulls */
|
||||
distinctPlan = (Plan *) make_aggCompat(targetList, NIL, AGG_HASHED,
|
||||
AGGSPLIT_SIMPLE, distinctClauseCount,
|
||||
distinctColumnIdArray,
|
||||
distinctColumnOpArray,
|
||||
NULL, NIL, NIL,
|
||||
rowEstimate, subPlan);
|
||||
extract_grouping_collations(
|
||||
distinctClauseList,
|
||||
subPlan->targetlist),
|
||||
NIL, NIL, rowEstimate, subPlan);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -676,7 +676,11 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
|
|||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
else if (rangeTableEntry->rtekind == RTE_VALUES)
|
||||
else if (rangeTableEntry->rtekind == RTE_VALUES
|
||||
#if PG_VERSION_NUM >= 120000
|
||||
|| rangeTableEntry->rtekind == RTE_RESULT
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* do nothing, this type is supported */
|
||||
}
|
||||
|
|
|
@ -1013,7 +1013,11 @@ DeferErrorIfUnsupportedTableCombination(Query *queryTree)
|
|||
* subquery, or immutable function.
|
||||
*/
|
||||
if (rangeTableEntry->rtekind == RTE_RELATION ||
|
||||
rangeTableEntry->rtekind == RTE_SUBQUERY)
|
||||
rangeTableEntry->rtekind == RTE_SUBQUERY
|
||||
#if PG_VERSION_NUM >= 120000
|
||||
|| rangeTableEntry->rtekind == RTE_RESULT
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* accepted */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue