You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2015/09/30 21:29:16 UTC
[04/14] hive git commit: HIVE-11468: (addendum) Vectorize Struct IN()
clauses (Matt McCline, via Gopal V)
HIVE-11468: (addendum) Vectorize Struct IN() clauses (Matt McCline, via Gopal V)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b801d12c
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b801d12c
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b801d12c
Branch: refs/heads/llap
Commit: b801d12cb43c48d45731aaafccc06f14484fc6ab
Parents: a5ffa71
Author: Gopal V <go...@apache.org>
Authored: Tue Sep 29 14:57:54 2015 -0700
Committer: Gopal V <go...@apache.org>
Committed: Tue Sep 29 14:57:54 2015 -0700
----------------------------------------------------------------------
.../ql/optimizer/physical/Vectorizer.java.rej | 86 --------------------
1 file changed, 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/b801d12c/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java.rej
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java.rej b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java.rej
deleted file mode 100644
index 5a10b58..0000000
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java.rej
+++ /dev/null
@@ -1,86 +0,0 @@
-***************
-*** 1255,1272 ****
- LOG.info("Cannot vectorize " + desc.toString() + " of type " + typeName);
- return false;
- }
- if (desc instanceof ExprNodeGenericFuncDesc) {
- ExprNodeGenericFuncDesc d = (ExprNodeGenericFuncDesc) desc;
- boolean r = validateGenericUdf(d);
- if (!r) {
- return false;
- }
- }
- if (desc.getChildren() != null) {
-- for (ExprNodeDesc d: desc.getChildren()) {
-- // Don't restrict child expressions for projection. Always use looser FILTER mode.
-- boolean r = validateExprNodeDescRecursive(d, VectorExpressionDescriptor.Mode.FILTER);
-- if (!r) {
- return false;
- }
- }
---- 1265,1329 ----
- LOG.info("Cannot vectorize " + desc.toString() + " of type " + typeName);
- return false;
- }
-+ boolean isInExpression = false;
- if (desc instanceof ExprNodeGenericFuncDesc) {
- ExprNodeGenericFuncDesc d = (ExprNodeGenericFuncDesc) desc;
- boolean r = validateGenericUdf(d);
- if (!r) {
- return false;
- }
-+ GenericUDF genericUDF = d.getGenericUDF();
-+ isInExpression = (genericUDF instanceof GenericUDFIn);
- }
- if (desc.getChildren() != null) {
-+ if (isInExpression &&
-+ desc.getChildren().get(0).getTypeInfo().getCategory() == Category.STRUCT) {
-+ boolean r = validateStructInExpression(desc, VectorExpressionDescriptor.Mode.FILTER);
-+ } else {
-+ for (ExprNodeDesc d: desc.getChildren()) {
-+ // Don't restrict child expressions for projection. Always use looser FILTER mode.
-+ boolean r = validateExprNodeDescRecursive(d, VectorExpressionDescriptor.Mode.FILTER);
-+ if (!r) {
-+ return false;
-+ }
-+ }
-+ }
-+ }
-+ return true;
-+ }
-+
-+ private boolean validateStructInExpression(ExprNodeDesc desc,
-+ VectorExpressionDescriptor.Mode mode) {
-+
-+ for (ExprNodeDesc d: desc.getChildren()) {
-+ TypeInfo typeInfo = d.getTypeInfo();
-+ if (typeInfo.getCategory() != Category.STRUCT){
-+ return false;
-+ }
-+ StructTypeInfo structTypeInfo = (StructTypeInfo) typeInfo;
-+
-+ ArrayList<TypeInfo> fieldTypeInfos = structTypeInfo.getAllStructFieldTypeInfos();
-+ ArrayList<String> fieldNames = structTypeInfo.getAllStructFieldNames();
-+ final int fieldCount = fieldTypeInfos.size();
-+ for (int f = 0; f < fieldCount; f++) {
-+ TypeInfo fieldTypeInfo = fieldTypeInfos.get(f);
-+ Category category = fieldTypeInfo.getCategory();
-+ if (category != Category.PRIMITIVE){
-+ LOG.info("Cannot vectorize struct field " + fieldNames.get(f) +
-+ " of type " + fieldTypeInfo.getTypeName());
-+ return false;
-+ }
-+ PrimitiveTypeInfo fieldPrimitiveTypeInfo = (PrimitiveTypeInfo) fieldTypeInfo;
-+ InConstantType inConstantType =
-+ VectorizationContext.getInConstantTypeFromPrimitiveCategory(
-+ fieldPrimitiveTypeInfo.getPrimitiveCategory());
-+
-+ // For now, limit the data types we support for Vectorized Struct IN().
-+ if (inConstantType != InConstantType.INT_FAMILY &&
-+ inConstantType != InConstantType.FLOAT_FAMILY &&
-+ inConstantType != InConstantType.STRING_FAMILY) {
-+ LOG.info("Cannot vectorize struct field " + fieldNames.get(f) +
-+ " of type " + fieldTypeInfo.getTypeName());
- return false;
- }
- }