Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1289#discussion_r140366008
--- Diff: src/backend/access/external/pxffilters.c ---
@@ -851,12 +852,51 @@ append_attr_from_var(Var* var, List* attrs)
return attrs;
}
+/*
+ * append_attr_from_func_args
+ *
+ * extracts all columns from FuncExpr into attrs
+ * assigns false to expressionIsSupported if at least one of items is not
supported
+ */
+static List*
+append_attr_from_func_args(FuncExpr *expr, List* attrs, bool*
expressionIsSupported) {
+ ListCell *lc = NULL;
+ if (!expressionIsSupported) {
+ return NIL;
+ }
+ foreach (lc, expr->args)
+ {
+ Node *node = (Node *) lfirst(lc);
+ if (IsA(node, FuncExpr)) {
+ attrs = append_attr_from_func_args((FuncExpr *) node,
attrs, expressionIsSupported);
+ } else if (IsA(node, Var)) {
+ attrs = append_attr_from_var((Var *) node, attrs);
+ } else if (IsA(node, OpExpr)) {
+ attrs = get_attrs_from_expr((OpExpr *) node,
expressionIsSupported);
+ } else {
+ *expressionIsSupported = false;
+ return NIL;
+ }
+ }
+
+ return attrs;
+
+}
+
+/*
+ * get_attrs_from_expr
+ *
+ * extracts and returns list of all columns from Expr
+ * assigns false to expressionIsSupported if at least one of items is not
supported
+ */
static List*
-get_attrs_from_expr(Expr *expr)
+get_attrs_from_expr(Expr *expr, bool* expressionIsSupported)
--- End diff --
I agree
---