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-532. Optimise vseg number for copy to statement.
Date Fri, 18 Mar 2016 04:38:31 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master b3a352186 -> 36571bce2


HAWQ-532. Optimise vseg number for copy to statement.


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

Branch: refs/heads/master
Commit: 36571bce2c96fce04ceb94f9ab78ace4cc90c66d
Parents: b3a3521
Author: hzhang2 <zhanghuan929@163.com>
Authored: Fri Mar 18 12:36:39 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Fri Mar 18 12:36:39 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/36571bce/src/backend/commands/copy.c
----------------------------------------------------------------------
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 2f4cf39..e37fb83 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -1888,11 +1888,12 @@ DoCopyTo(CopyState cstate)
 			 */
 			PartitionNode *pn = get_parts(cstate->rel->rd_id, 0 /*level*/ ,
 													0 /*parent*/, false /* inctemplate */, CurrentMemoryContext, true /*includesubparts*/);
-			Assert(pn);
 			List		*lFullRelOids = NIL;
-			lFullRelOids = all_leaf_partition_relids(pn);
-			lFullRelOids = lappend_oid(lFullRelOids, cstate->rel->rd_id); /* root partition
*/
-			lFullRelOids = list_concat(lFullRelOids, all_interior_partition_relids(pn)); /* interior
partitions */
+			if(pn){
+				lFullRelOids = all_leaf_partition_relids(pn);
+				lFullRelOids = list_concat(lFullRelOids, all_interior_partition_relids(pn)); /* interior
partitions */
+			}
+			lFullRelOids = lappend_oid(lFullRelOids, cstate->rel->rd_id);
 
 			target_segment_num = calculate_virtual_segment_number(lFullRelOids);
 			elog(LOG, "virtual segment number of copy to is: %d\n", target_segment_num);


Mime
View raw message