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-1053. Fixed extraction logic for varchar type.
Date Fri, 16 Sep 2016 19:03:06 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6416b536d -> 981c0a939


HAWQ-1053. Fixed extraction logic for varchar type.


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

Branch: refs/heads/master
Commit: 981c0a9393062632a1837e120df7b74590c03fa7
Parents: 6416b53
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Fri Sep 16 12:02:56 2016 -0700
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Fri Sep 16 12:02:56 2016 -0700

----------------------------------------------------------------------
 src/backend/access/external/pxffilters.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/981c0a93/src/backend/access/external/pxffilters.c
----------------------------------------------------------------------
diff --git a/src/backend/access/external/pxffilters.c b/src/backend/access/external/pxffilters.c
index cdb2cb6..6767735 100644
--- a/src/backend/access/external/pxffilters.c
+++ b/src/backend/access/external/pxffilters.c
@@ -494,14 +494,29 @@ get_attrs_from_expr(Expr *expr)
 		rightop = (Node *) lsecond(saop->args);
 	}
 
+	//Process left operand
+	//For most of datatypes column is represented by Var node
 	if (IsA(leftop, Var))
 	{
 		attrs = append_attr_from_var((Var *) leftop, attrs);
 	}
-	if (IsA(leftop, Const))
+	//For varchar column is represented by RelabelType node
+	if (IsA(leftop, RelabelType))
+	{
+		attrs = append_attr_from_var((Var *) ((RelabelType *) leftop)->arg, attrs);
+	}
+
+	//Process right operand
+	//For most of datatypes column is represented by Var node
+	if (IsA(rightop, Var))
 	{
 		attrs = append_attr_from_var((Var *) rightop, attrs);
 	}
+	//For varchar column is represented by RelabelType node
+	if (IsA(rightop, RelabelType))
+	{
+		attrs = append_attr_from_var((Var *) ((RelabelType *) rightop)->arg, attrs);
+	}
 
 	return attrs;
 


Mime
View raw message