hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject incubator-hawq git commit: HAWQ-616. Mininum resource needed by copy random table from a file should be one.
Date Fri, 01 Apr 2016 02:26:52 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 7fef48058 -> 071f276bc


HAWQ-616. Mininum resource needed by copy random table from a file should be one.


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

Branch: refs/heads/master
Commit: 071f276bc3c3e14b818ecf584a5697a2ebf24870
Parents: 7fef480
Author: hzhang2 <zhanghuan929@163.com>
Authored: Fri Apr 1 10:26:28 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Fri Apr 1 10:26:28 2016 +0800

----------------------------------------------------------------------
 src/backend/commands/copy.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/071f276b/src/backend/commands/copy.c
----------------------------------------------------------------------
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 2ed87e6..6dc41c1 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -1557,7 +1557,8 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
 			Oid		relid = RelationGetRelid(cstate->rel);
 			List	*all_relids = NIL;
 			GpPolicy *target_policy = NULL;
-			int target_segment_num = 0;
+			int min_target_segment_num = 0;
+			int max_target_segment_num = 0;
 			QueryResource *savedResource = NULL;
 
 			target_policy = GpPolicyFetch(CurrentMemoryContext, relid);
@@ -1567,14 +1568,16 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
 			 * For random table, we use a fixed GUC value to request vsegs.
 			 */
 			if(target_policy->nattrs > 0){
-				target_segment_num = target_policy->bucketnum;
+				min_target_segment_num = target_policy->bucketnum;
+				max_target_segment_num = target_policy->bucketnum;
 			}
 			else{
-				target_segment_num = hawq_rm_nvseg_for_copy_from_perquery;
+				min_target_segment_num = 1;
+				max_target_segment_num = hawq_rm_nvseg_for_copy_from_perquery;
 			}
 			pfree(target_policy);
 
-			cstate->resource = AllocateResource(QRL_ONCE, 1, 1, target_segment_num, target_segment_num,NULL,0);
+			cstate->resource = AllocateResource(QRL_ONCE, 1, 1, max_target_segment_num, min_target_segment_num,NULL,0);
 			savedResource = GetActiveQueryResource();
 			SetActiveQueryResource(cstate->resource);
 			all_relids = lappend_oid(all_relids, relid);


Mime
View raw message