From 57380fd6681d4cb4f87df8288f526648f0911770 Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Mon, 11 Nov 2019 13:51:21 +0300 Subject: [PATCH] remove duplicated method in multi_logical_optimizer (#3166) --- .../planner/multi_logical_optimizer.c | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/backend/distributed/planner/multi_logical_optimizer.c b/src/backend/distributed/planner/multi_logical_optimizer.c index 0da294be9..ab54676f2 100644 --- a/src/backend/distributed/planner/multi_logical_optimizer.c +++ b/src/backend/distributed/planner/multi_logical_optimizer.c @@ -267,8 +267,6 @@ static void ErrorIfContainsUnsupportedAggregate(MultiNode *logicalPlanNode); static void ErrorIfUnsupportedArrayAggregate(Aggref *arrayAggregateExpression); static void ErrorIfUnsupportedJsonAggregate(AggregateType type, Aggref *aggregateExpression); -static void ErrorIfUnsupportedJsonObjectAggregate(AggregateType type, - Aggref *aggregateExpression); static void ErrorIfUnsupportedAggregateDistinct(Aggref *aggregateExpression, MultiNode *logicalPlanNode); static Var * AggregateDistinctColumn(Aggref *aggregateExpression); @@ -3209,7 +3207,7 @@ ErrorIfContainsUnsupportedAggregate(MultiNode *logicalPlanNode) else if (aggregateType == AGGREGATE_JSONB_OBJECT_AGG || aggregateType == AGGREGATE_JSON_OBJECT_AGG) { - ErrorIfUnsupportedJsonObjectAggregate(aggregateType, aggregateExpression); + ErrorIfUnsupportedJsonAggregate(aggregateType, aggregateExpression); } 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 * (distinct expression) and push it down to the worker node. It handles count