hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: Revert "HAWQ-198. Build-in functions will be executed in resource_negotiator stage which causes it will be executed twice"
Date Fri, 26 Feb 2016 10:57:45 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6fb57949a -> 598bb4366


Revert "HAWQ-198. Build-in functions will be executed in resource_negotiator stage which causes
it will be executed twice"

This reverts commit 3d39d8f3f9c8ff8b0c5fd7d765d2ba569467c717.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/598bb436
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/598bb436
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/598bb436

Branch: refs/heads/master
Commit: 598bb436650809011732ff96b667df8ac9712203
Parents: 6fb5794
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Fri Feb 26 18:57:19 2016 +0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Fri Feb 26 18:57:19 2016 +0800

----------------------------------------------------------------------
 src/backend/optimizer/plan/planner.c | 34 -------------------------------
 src/backend/optimizer/util/clauses.c | 11 ++--------
 src/include/optimizer/planner.h      |  4 ----
 3 files changed, 2 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/598bb436/src/backend/optimizer/plan/planner.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 025f53e..c98ba49 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -91,8 +91,6 @@ planner_hook_type planner_hook = NULL;
 
 ParamListInfo PlannerBoundParamList = NULL;		/* current boundParams */
 
-static int PlanningDepth = 0;		/* Planning depth */
-
 /* Expression kind codes for preprocess_expression */
 #define EXPRKIND_QUAL			0
 #define EXPRKIND_TARGET			1
@@ -167,32 +165,6 @@ static void sort_canonical_gs_list(List *gs, int *p_nsets, Bitmapset
***p_sets);
 static Plan *pushdown_preliminary_limit(Plan *plan, Node *limitCount, int64 count_est, Node
*limitOffset, int64 offset_est);
 bool is_dummy_plan(Plan *plan);
 
-
-bool is_in_planning_phase(void)
-{
-	if (PlanningDepth > 0)
-	{
-		return true;
-	}
-	else if (PlanningDepth < 0)
-	{
-		elog(ERROR, "Invalid PlanningDepth %d while getting planning phase", PlanningDepth);
-	}
-
-	return false;
-}
-
-void increase_planning_depth(void)
-{
-	PlanningDepth++;
-}
-
-void decrease_planning_depth(void)
-{
-	PlanningDepth--;
-}
-
-
 #ifdef USE_ORCA
 /**
  * Logging of optimization outcome
@@ -328,8 +300,6 @@ planner(Query *parse, int cursorOptions,
 	 * resource to run this query. After gaining the resource, we can perform the
 	 * actual optimization.
 	 */
-	increase_planning_depth();
-
 	plannerLevel++;
 	if (!resourceNegotiateDone)
 	{
@@ -339,8 +309,6 @@ planner(Query *parse, int cursorOptions,
       {
         resource_negotiator(parse, cursorOptions, boundParams, resourceLife, &ppResult);
 
-		decrease_planning_depth();
-
 		if(ppResult->stmt && ppResult->stmt->planTree)
 		{
 			isDispatchParallel = ppResult->stmt->planTree->dispatch == DISPATCH_PARALLEL;
@@ -350,8 +318,6 @@ planner(Query *parse, int cursorOptions,
 	  }
 	  PG_CATCH();
 	  {
-		decrease_planning_depth();
-
 		if ((ppResult != NULL))
 		{
 		  pfree(ppResult);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/598bb436/src/backend/optimizer/util/clauses.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index a3d67f2..a80737f 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -2831,15 +2831,8 @@ simplify_function(Oid funcid, Oid result_type, List *args,
 	if (!HeapTupleIsValid(func_tuple))
 		elog(ERROR, "cache lookup failed for function %u", funcid);
 
-	if (is_in_planning_phase())
-	{
-		newexpr = NULL;
-	}
-	else
-	{
-		newexpr = evaluate_function(funcid, result_type, args,
-		                            func_tuple, context);
-	}
+	newexpr = evaluate_function(funcid, result_type, args,
+								func_tuple, context);
 
 	if (large_const(newexpr, context->max_size))
 	{

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/598bb436/src/include/optimizer/planner.h
----------------------------------------------------------------------
diff --git a/src/include/optimizer/planner.h b/src/include/optimizer/planner.h
index cc2eb7d..48de348 100644
--- a/src/include/optimizer/planner.h
+++ b/src/include/optimizer/planner.h
@@ -50,8 +50,4 @@ extern bool choose_hashed_grouping(PlannerInfo *root,
 								   double dNumGroups, 
 								   AggClauseCounts *agg_counts);
 
-extern bool is_in_planning_phase(void);
-extern void increase_planning_depth(void);
-extern void decrease_planning_depth(void);
-
 #endif   /* PLANNER_H */


Mime
View raw message