hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject incubator-hawq git commit: HAWQ-967. Support OR, NOT.
Date Thu, 11 Aug 2016 01:11:51 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-967 64c3af080 -> 36f68c2af


HAWQ-967. Support OR, NOT.


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

Branch: refs/heads/HAWQ-967
Commit: 36f68c2af4bdad75f051161e423ff46670cbf689
Parents: 64c3af0
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Wed Aug 10 18:09:25 2016 -0700
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Wed Aug 10 18:09:25 2016 -0700

----------------------------------------------------------------------
 src/backend/access/external/pxffilters.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/36f68c2a/src/backend/access/external/pxffilters.c
----------------------------------------------------------------------
diff --git a/src/backend/access/external/pxffilters.c b/src/backend/access/external/pxffilters.c
index 056eb44..9120bb7 100644
--- a/src/backend/access/external/pxffilters.c
+++ b/src/backend/access/external/pxffilters.c
@@ -31,7 +31,7 @@
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
 
-static List* pxf_make_filter_list(List* quals);
+static List* pxf_make_filter_list(List* quals, bool extractAttrs);
 static void pxf_free_filter(PxfFilterDesc* filter);
 static void pxf_free_filter_list(List *filters);
 static char* pxf_serialize_filter_list(List *filters);
@@ -155,7 +155,7 @@ Oid pxf_supported_types[] =
  * Caller is responsible for pfreeing the returned PxfFilterDesc List.
  */
 static List *
-pxf_make_filter_list(List *quals)
+pxf_make_filter_list(List *quals, bool extractAttrs)
 {
 	List			*result = NIL;
 	ListCell		*lc = NULL;
@@ -196,10 +196,11 @@ pxf_make_filter_list(List *quals)
 				elog(DEBUG5, "pxf_make_filter_list: node tag %d (T_BoolExpr), bool node type %d %s",
 						tag, boolType, boolType==AND_EXPR ? "(AND_EXPR)" : "");
 
-				/* only AND_EXPR is supported */
-				if (expr->boolop == AND_EXPR)
+				/* only AND_EXPR is supported for filter push-down*/
+				/* AND_EXPR, OR_EXPR, NOT_EXPR are supported for extracting attributes from WHERE clause*/
+				if (expr->boolop == AND_EXPR || extractAttrs)
 				{
-					List *inner_result = pxf_make_filter_list(expr->args);
+					List *inner_result = pxf_make_filter_list(expr->args, extractAttrs);
 					elog(DEBUG5, "pxf_make_filter_list: inner result size %d", list_length(inner_result));
 					result = list_concat(result, inner_result);
 				}
@@ -580,7 +581,7 @@ char *serializePxfFilterQuals(List *quals)
 
 	if (pxf_enable_filter_pushdown)
 	{
-		List *filters = pxf_make_filter_list(quals);
+		List *filters = pxf_make_filter_list(quals, false);
 
 		result  = pxf_serialize_filter_list(filters);
 		pxf_free_filter_list(filters);
@@ -593,7 +594,7 @@ char *serializePxfFilterQuals(List *quals)
 List* extractPxfAttributes(List* quals)
 {
 
-	List *filters = pxf_make_filter_list(quals);
+	List *filters = pxf_make_filter_list(quals, true);
 
 	List *attributes = pxf_extract_attributes(filters);
 


Mime
View raw message