hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iw...@apache.org
Subject incubator-hawq git commit: HAWQ-428. ORDER/GROUP BY not found in target list error found in olap query
Date Mon, 22 Feb 2016 02:41:26 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 286f1223f -> 1a29a073a


HAWQ-428. ORDER/GROUP BY not found in target list error found in olap query


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

Branch: refs/heads/master
Commit: 1a29a073a8e4d26c5414703e51ddf3bc681a80a4
Parents: 286f122
Author: ivan <iweng@pivotal.io>
Authored: Mon Feb 22 10:33:28 2016 +0800
Committer: ivan <iweng@pivotal.io>
Committed: Mon Feb 22 10:41:07 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbmetadatacache_process.c |  1 +
 src/backend/optimizer/plan/plangroupext.c  |  7 ++++++-
 src/backend/optimizer/util/tlist.c         | 14 +++++++++++++-
 src/include/optimizer/tlist.h              |  2 ++
 4 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a29a073/src/backend/cdb/cdbmetadatacache_process.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbmetadatacache_process.c b/src/backend/cdb/cdbmetadatacache_process.c
index 273923a..6d1292c 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -392,6 +392,7 @@ GenerateMetadataCacheRefreshList()
             MetadataCacheRefreshList = lappend(MetadataCacheRefreshList, refresh_info);
             if (list_length(MetadataCacheRefreshList) >= metadata_cache_refresh_max_num)
             {
+                hash_seq_term(&hstat);
                 break;
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a29a073/src/backend/optimizer/plan/plangroupext.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/plangroupext.c b/src/backend/optimizer/plan/plangroupext.c
index 57b38ac..665f303 100644
--- a/src/backend/optimizer/plan/plangroupext.c
+++ b/src/backend/optimizer/plan/plangroupext.c
@@ -1867,7 +1867,12 @@ convert_gs_to_rollups(AttrNumber *grpColIdx,
 		 * resno.
 		 */
 		sc.tleSortGroupRef = no+1;
-		tle = get_sortgroupclause_tle(&sc, tlist);
+		tle = get_sortgroupclause_tle_internal(&sc, tlist);
+        if (NULL == tle) 
+        {
+            continue;
+        }
+
 		foreach (sub_lc, sub_tlist)
 		{
 			TargetEntry *sub_tle = (TargetEntry *)lfirst(sub_lc);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a29a073/src/backend/optimizer/util/tlist.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c
index ce30db9..35d813a 100644
--- a/src/backend/optimizer/util/tlist.c
+++ b/src/backend/optimizer/util/tlist.c
@@ -209,6 +209,18 @@ TargetEntry *
 get_sortgroupclause_tle(SortClause *sortClause,
 						List *targetList)
 {
+    TargetEntry *ret = get_sortgroupclause_tle_internal(sortClause, targetList);
+    if (NULL == ret) {
+	    elog(ERROR, "ORDER/GROUP BY expression not found in targetlist");
+    }
+	
+	return ret;				/* keep compiler quiet */
+}
+
+TargetEntry *
+get_sortgroupclause_tle_internal(SortClause *sortClause,
+						List *targetList)
+{
 	Index		refnumber = sortClause->tleSortGroupRef;
 	ListCell   *l;
 
@@ -220,10 +232,10 @@ get_sortgroupclause_tle(SortClause *sortClause,
 			return tle;
 	}
 
-	elog(ERROR, "ORDER/GROUP BY expression not found in targetlist");
 	return NULL;				/* keep compiler quiet */
 }
 
+
 /*
  * get_sortgroupclauses_tles
  *      Find a list of unique targetlist entries matching the given list of

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a29a073/src/include/optimizer/tlist.h
----------------------------------------------------------------------
diff --git a/src/include/optimizer/tlist.h b/src/include/optimizer/tlist.h
index 0f847c0..e654551 100644
--- a/src/include/optimizer/tlist.h
+++ b/src/include/optimizer/tlist.h
@@ -46,6 +46,8 @@ extern TargetEntry *tlist_member_ignoring_RelabelType(Expr *expr, List *targetli
 extern List *flatten_tlist(List *tlist);
 extern List *add_to_flat_tlist(List *tlist, List *vars, bool resjunk);
 
+extern TargetEntry *get_sortgroupclause_tle_internal(SortClause *sortClause,
+						List *targetList);
 extern TargetEntry *get_sortgroupclause_tle(SortClause *sortClause,
 						List *targetList);
 extern Node *get_sortgroupclause_expr(SortClause *sortClause,


Mime
View raw message