remove duplicated method in multi_logical_optimizer (#3166)

pull/3171/head
SaitTalhaNisanci 2019-11-11 13:51:21 +03:00 committed by GitHub
parent 460f000218
commit 57380fd668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 30 deletions

View File

@ -267,8 +267,6 @@ static void ErrorIfContainsUnsupportedAggregate(MultiNode *logicalPlanNode);
static void ErrorIfUnsupportedArrayAggregate(Aggref *arrayAggregateExpression); static void ErrorIfUnsupportedArrayAggregate(Aggref *arrayAggregateExpression);
static void ErrorIfUnsupportedJsonAggregate(AggregateType type, static void ErrorIfUnsupportedJsonAggregate(AggregateType type,
Aggref *aggregateExpression); Aggref *aggregateExpression);
static void ErrorIfUnsupportedJsonObjectAggregate(AggregateType type,
Aggref *aggregateExpression);
static void ErrorIfUnsupportedAggregateDistinct(Aggref *aggregateExpression, static void ErrorIfUnsupportedAggregateDistinct(Aggref *aggregateExpression,
MultiNode *logicalPlanNode); MultiNode *logicalPlanNode);
static Var * AggregateDistinctColumn(Aggref *aggregateExpression); static Var * AggregateDistinctColumn(Aggref *aggregateExpression);
@ -3209,7 +3207,7 @@ ErrorIfContainsUnsupportedAggregate(MultiNode *logicalPlanNode)
else if (aggregateType == AGGREGATE_JSONB_OBJECT_AGG || else if (aggregateType == AGGREGATE_JSONB_OBJECT_AGG ||
aggregateType == AGGREGATE_JSON_OBJECT_AGG) aggregateType == AGGREGATE_JSON_OBJECT_AGG)
{ {
ErrorIfUnsupportedJsonObjectAggregate(aggregateType, aggregateExpression); ErrorIfUnsupportedJsonAggregate(aggregateType, aggregateExpression);
} }
else if (aggregateExpression->aggdistinct) else if (aggregateExpression->aggdistinct)
{ {
@ -3270,33 +3268,6 @@ ErrorIfUnsupportedJsonAggregate(AggregateType type,
} }
/*
* ErrorIfUnsupportedJsonObjectAggregate checks if we can transform the
* json object aggregate expression and push it down to the worker node.
* If we cannot transform the aggregate, this function errors.
*/
static void
ErrorIfUnsupportedJsonObjectAggregate(AggregateType type,
Aggref *aggregateExpression)
{
/* if json object aggregate has order by, we error out */
if (aggregateExpression->aggorder)
{
const char *name = AggregateNames[type];
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("%s with order by is unsupported", name)));
}
/* if json object aggregate has distinct, we error out */
if (aggregateExpression->aggdistinct)
{
const char *name = AggregateNames[type];
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("%s (distinct) is unsupported", name)));
}
}
/* /*
* ErrorIfUnsupportedAggregateDistinct checks if we can transform the aggregate * ErrorIfUnsupportedAggregateDistinct checks if we can transform the aggregate
* (distinct expression) and push it down to the worker node. It handles count * (distinct expression) and push it down to the worker node. It handles count