Repository: incubator-hawq Updated Branches: refs/heads/master e6c7fda07 -> 281014e5c
HAWQ-1052. Fixed extraction logic for boolean datatype. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/281014e5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/281014e5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/281014e5 Branch: refs/heads/master Commit: 281014e5c77c5e35fb7919902a7d9bea8f3dab1c Parents: e6c7fda Author: Oleksandr Diachenko <odiache...@pivotal.io> Authored: Tue Sep 20 17:24:29 2016 -0700 Committer: Oleksandr Diachenko <odiache...@pivotal.io> Committed: Tue Sep 20 17:24:29 2016 -0700 ---------------------------------------------------------------------- src/backend/access/external/pxffilters.c | 13 +++++++++++-- src/backend/access/external/pxfheaders.c | 9 +++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/281014e5/src/backend/access/external/pxffilters.c ---------------------------------------------------------------------- diff --git a/src/backend/access/external/pxffilters.c b/src/backend/access/external/pxffilters.c index 6767735..354c719 100644 --- a/src/backend/access/external/pxffilters.c +++ b/src/backend/access/external/pxffilters.c @@ -639,6 +639,7 @@ char *serializePxfFilterQuals(List *quals) /* * Returns a list of attributes, extracted from quals. + * Returns NIL if any error occurred. * Supports AND, OR, NOT operations. * Supports =, <, <=, >, >=, IS NULL, IS NOT NULL, BETWEEN, IN operators. * List might contain duplicates. @@ -681,15 +682,23 @@ List* extractPxfAttributes(List* quals) attributes = append_attr_from_var((Var *) expr->arg, attributes); break; } + case T_BooleanTest: + { + BooleanTest* expr = (BooleanTest *) node; + attributes = append_attr_from_var((Var *) expr->arg, attributes); + break; + } default: + { /* * tag is not supported, it's risk of having: * 1) false-positive tuples * 2) unable to join tables * 3) etc */ - elog(ERROR, "extractPxfAttributes: unsupported node tag %d, unable to extract attribute from qualifier", tag); - break; + elog(INFO, "extractPxfAttributes: unsupported node tag %d, unable to extract attribute from qualifier", tag); + return NIL; + } } } http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/281014e5/src/backend/access/external/pxfheaders.c ---------------------------------------------------------------------- diff --git a/src/backend/access/external/pxfheaders.c b/src/backend/access/external/pxfheaders.c index 07c41c1..2016c64 100644 --- a/src/backend/access/external/pxfheaders.c +++ b/src/backend/access/external/pxfheaders.c @@ -66,8 +66,13 @@ void build_http_header(PxfInputData *input) if (proj_info != NULL && proj_info->pi_isVarList) { List* qualsAttributes = extractPxfAttributes(input->quals); - - add_projection_desc_httpheader(headers, proj_info, qualsAttributes); + /* projection information is incomplete if columns from WHERE clause wasn't extracted */ + if (qualsAttributes != NIL || list_length(input->quals) == 0) + { + add_projection_desc_httpheader(headers, proj_info, qualsAttributes); + } + else + elog(INFO, "Query will not be optimized to use projection information"); } /* GP cluster configuration */