[01/18] incubator-hawq git commit: HAWQ-1048. Draft implementation.

2016-10-05 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-964 [created] 509aef120


HAWQ-1048. Draft implementation.


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

Branch: refs/heads/HAWQ-964
Commit: cd186f6fb3ab6bc74833ef5184da03f113ee7995
Parents: 981c0a9
Author: Oleksandr Diachenko 
Authored: Fri Sep 16 19:00:50 2016 -0700
Committer: Oleksandr Diachenko 
Committed: Fri Sep 16 19:00:50 2016 -0700

--
 src/backend/access/external/pxffilters.c | 152 --
 src/include/access/pxffilters.h  |   9 +-
 2 files changed, 80 insertions(+), 81 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cd186f6f/src/backend/access/external/pxffilters.c
--
diff --git a/src/backend/access/external/pxffilters.c 
b/src/backend/access/external/pxffilters.c
index 6767735..76e83b4 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_expression_items_list(List *quals);
 static void pxf_free_filter(PxfFilterDesc* filter);
 static void pxf_free_filter_list(List *filters);
 static char* pxf_serialize_filter_list(List *filters);
@@ -157,7 +157,7 @@ Oid pxf_supported_types[] =
 };
 
 /*
- * pxf_make_filter_list
+ * pxf_make_expression_items_list
  *
  * Given a scan node qual list, find the filters that are eligible to be used
  * by PXF, construct a PxfFilterDesc list that describes the filter 
information,
@@ -166,7 +166,7 @@ Oid pxf_supported_types[] =
  * Caller is responsible for pfreeing the returned PxfFilterDesc List.
  */
 static List *
-pxf_make_filter_list(List *quals)
+pxf_make_expression_items_list(List *quals)
 {
List*result = NIL;
ListCell*lc = NULL;
@@ -174,10 +174,6 @@ pxf_make_filter_list(List *quals)
if (list_length(quals) == 0)
return NIL;
 
-   /*
-* Iterate over all implicitly ANDed qualifiers and add the ones
-* that are supported for push-down into the result filter list.
-*/
foreach (lc, quals)
{
Node *node = (Node *) lfirst(lc);
@@ -187,38 +183,19 @@ pxf_make_filter_list(List *quals)
{
case T_OpExpr:
{
-   OpExpr  *expr   = (OpExpr *) 
node;
-   PxfFilterDesc   *filter;
-
-   filter = (PxfFilterDesc *) 
palloc0(sizeof(PxfFilterDesc));
-   elog(DEBUG5, "pxf_make_filter_list: node tag %d 
(T_OpExpr)", tag);
-
-   if (opexpr_to_pxffilter(expr, filter))
-   result = lappend(result, filter);
-   else
-   pfree(filter);
-
+   result = lappend(result, node);
break;
}
case T_BoolExpr:
{
BoolExpr*expr = (BoolExpr *) node;
-   BoolExprType boolType = expr->boolop;
-   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)
-   {
-   List *inner_result = 
pxf_make_filter_list(expr->args);
-   elog(DEBUG5, "pxf_make_filter_list: 
inner result size %d", list_length(inner_result));
-   result = list_concat(result, 
inner_result);
-   }
+   List *inner_result = 
pxf_make_expression_items_list(expr->args);
+   result = list_concat(result, inner_result);
+   result = lappend(result, node);
break;
}
default:
-   /* expression not supported. ignore */
-   elog(DEBUG5, "pxf_make_filter_list: unsupported 
node tag %d", tag);
+ 

[1/4] incubator-hawq git commit: HAWQ-1048. Draft implementation.

2016-09-21 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-1048 [created] 0ff70373b


HAWQ-1048. Draft implementation.


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

Branch: refs/heads/HAWQ-1048
Commit: cd186f6fb3ab6bc74833ef5184da03f113ee7995
Parents: 981c0a9
Author: Oleksandr Diachenko 
Authored: Fri Sep 16 19:00:50 2016 -0700
Committer: Oleksandr Diachenko 
Committed: Fri Sep 16 19:00:50 2016 -0700

--
 src/backend/access/external/pxffilters.c | 152 --
 src/include/access/pxffilters.h  |   9 +-
 2 files changed, 80 insertions(+), 81 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cd186f6f/src/backend/access/external/pxffilters.c
--
diff --git a/src/backend/access/external/pxffilters.c 
b/src/backend/access/external/pxffilters.c
index 6767735..76e83b4 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_expression_items_list(List *quals);
 static void pxf_free_filter(PxfFilterDesc* filter);
 static void pxf_free_filter_list(List *filters);
 static char* pxf_serialize_filter_list(List *filters);
@@ -157,7 +157,7 @@ Oid pxf_supported_types[] =
 };
 
 /*
- * pxf_make_filter_list
+ * pxf_make_expression_items_list
  *
  * Given a scan node qual list, find the filters that are eligible to be used
  * by PXF, construct a PxfFilterDesc list that describes the filter 
information,
@@ -166,7 +166,7 @@ Oid pxf_supported_types[] =
  * Caller is responsible for pfreeing the returned PxfFilterDesc List.
  */
 static List *
-pxf_make_filter_list(List *quals)
+pxf_make_expression_items_list(List *quals)
 {
List*result = NIL;
ListCell*lc = NULL;
@@ -174,10 +174,6 @@ pxf_make_filter_list(List *quals)
if (list_length(quals) == 0)
return NIL;
 
-   /*
-* Iterate over all implicitly ANDed qualifiers and add the ones
-* that are supported for push-down into the result filter list.
-*/
foreach (lc, quals)
{
Node *node = (Node *) lfirst(lc);
@@ -187,38 +183,19 @@ pxf_make_filter_list(List *quals)
{
case T_OpExpr:
{
-   OpExpr  *expr   = (OpExpr *) 
node;
-   PxfFilterDesc   *filter;
-
-   filter = (PxfFilterDesc *) 
palloc0(sizeof(PxfFilterDesc));
-   elog(DEBUG5, "pxf_make_filter_list: node tag %d 
(T_OpExpr)", tag);
-
-   if (opexpr_to_pxffilter(expr, filter))
-   result = lappend(result, filter);
-   else
-   pfree(filter);
-
+   result = lappend(result, node);
break;
}
case T_BoolExpr:
{
BoolExpr*expr = (BoolExpr *) node;
-   BoolExprType boolType = expr->boolop;
-   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)
-   {
-   List *inner_result = 
pxf_make_filter_list(expr->args);
-   elog(DEBUG5, "pxf_make_filter_list: 
inner result size %d", list_length(inner_result));
-   result = list_concat(result, 
inner_result);
-   }
+   List *inner_result = 
pxf_make_expression_items_list(expr->args);
+   result = list_concat(result, inner_result);
+   result = lappend(result, node);
break;
}
default:
-   /* expression not supported. ignore */
-   elog(DEBUG5, "pxf_make_filter_list: unsupported 
node tag %d", tag);
+   

incubator-hawq git commit: HAWQ-1048. Draft implementation.

2016-09-16 Thread odiachenko
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-1048 [created] cd186f6fb


HAWQ-1048. Draft implementation.


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

Branch: refs/heads/HAWQ-1048
Commit: cd186f6fb3ab6bc74833ef5184da03f113ee7995
Parents: 981c0a9
Author: Oleksandr Diachenko 
Authored: Fri Sep 16 19:00:50 2016 -0700
Committer: Oleksandr Diachenko 
Committed: Fri Sep 16 19:00:50 2016 -0700

--
 src/backend/access/external/pxffilters.c | 152 --
 src/include/access/pxffilters.h  |   9 +-
 2 files changed, 80 insertions(+), 81 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cd186f6f/src/backend/access/external/pxffilters.c
--
diff --git a/src/backend/access/external/pxffilters.c 
b/src/backend/access/external/pxffilters.c
index 6767735..76e83b4 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_expression_items_list(List *quals);
 static void pxf_free_filter(PxfFilterDesc* filter);
 static void pxf_free_filter_list(List *filters);
 static char* pxf_serialize_filter_list(List *filters);
@@ -157,7 +157,7 @@ Oid pxf_supported_types[] =
 };
 
 /*
- * pxf_make_filter_list
+ * pxf_make_expression_items_list
  *
  * Given a scan node qual list, find the filters that are eligible to be used
  * by PXF, construct a PxfFilterDesc list that describes the filter 
information,
@@ -166,7 +166,7 @@ Oid pxf_supported_types[] =
  * Caller is responsible for pfreeing the returned PxfFilterDesc List.
  */
 static List *
-pxf_make_filter_list(List *quals)
+pxf_make_expression_items_list(List *quals)
 {
List*result = NIL;
ListCell*lc = NULL;
@@ -174,10 +174,6 @@ pxf_make_filter_list(List *quals)
if (list_length(quals) == 0)
return NIL;
 
-   /*
-* Iterate over all implicitly ANDed qualifiers and add the ones
-* that are supported for push-down into the result filter list.
-*/
foreach (lc, quals)
{
Node *node = (Node *) lfirst(lc);
@@ -187,38 +183,19 @@ pxf_make_filter_list(List *quals)
{
case T_OpExpr:
{
-   OpExpr  *expr   = (OpExpr *) 
node;
-   PxfFilterDesc   *filter;
-
-   filter = (PxfFilterDesc *) 
palloc0(sizeof(PxfFilterDesc));
-   elog(DEBUG5, "pxf_make_filter_list: node tag %d 
(T_OpExpr)", tag);
-
-   if (opexpr_to_pxffilter(expr, filter))
-   result = lappend(result, filter);
-   else
-   pfree(filter);
-
+   result = lappend(result, node);
break;
}
case T_BoolExpr:
{
BoolExpr*expr = (BoolExpr *) node;
-   BoolExprType boolType = expr->boolop;
-   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)
-   {
-   List *inner_result = 
pxf_make_filter_list(expr->args);
-   elog(DEBUG5, "pxf_make_filter_list: 
inner result size %d", list_length(inner_result));
-   result = list_concat(result, 
inner_result);
-   }
+   List *inner_result = 
pxf_make_expression_items_list(expr->args);
+   result = list_concat(result, inner_result);
+   result = lappend(result, node);
break;
}
default:
-   /* expression not supported. ignore */
-   elog(DEBUG5, "pxf_make_filter_list: unsupported 
node tag %d", tag);
+