Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcCtx.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcCtx.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcCtx.java (revision 0) @@ -0,0 +1,128 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.optimizer; + + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hive.ql.exec.ColumnInfo; +import org.apache.hadoop.hive.ql.exec.Operator; +import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx; +import org.apache.hadoop.hive.ql.parse.OpParseContext; +import org.apache.hadoop.hive.ql.parse.RowResolver; +import org.apache.hadoop.hive.ql.parse.SemanticException; +import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc; +import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; +import org.apache.hadoop.hive.ql.plan.OperatorDesc; + +/** + * This class implements the processor context for Column Pruner. + */ +public class ConstantPropagateProcCtx implements NodeProcessorCtx { + + private static final org.apache.commons.logging.Log LOG = LogFactory + .getLog(ConstantPropagateProcCtx.class); + + private final Map, Map> opToConstantExprs; + + private final Map, OpParseContext> opToParseCtxMap; + + private final List> opToDelete; + + public ConstantPropagateProcCtx( + Map, OpParseContext> opToParseCtxMap) { + opToConstantExprs = new HashMap, Map>(); + opToDelete = new ArrayList>(); + this.opToParseCtxMap = opToParseCtxMap; + } + + public Map, Map> getOpToConstantExprs() { + return opToConstantExprs; + } + + public Map, OpParseContext> getOpToParseCtxMap() { + return opToParseCtxMap; + } + + public Map getPropagatedConstants( + Operator op) { + Map constants = new HashMap(); + RowResolver rr = opToParseCtxMap.get(op).getRowResolver(); + LOG.debug("Current rr of op:" + op + " is " + rr); + try { + if (op.getParentOperators() == null) { + return constants; + } + for (Operator parent : op.getParentOperators()) { + RowResolver inputRR = opToParseCtxMap.get(parent).getRowResolver(); + Map c = opToConstantExprs.get(parent); + for (Entry e : c.entrySet()) { + ColumnInfo ci = e.getKey(); + // Get genuine column alias (instead of retrieve from ColumnInfo, which is unreliable). + String tmp[] = inputRR.reverseLookup(ci.getInternalName()); + ColumnInfo nci = rr.get(tmp[0], tmp[1]); + if (nci != null) { + constants.put(nci, e.getValue()); + } + } + } + LOG.debug("Offerring constants " + StringUtils.join(constants.keySet(), ",") + + " to operator " + op.toString()); + return constants; + } catch (SemanticException e) { + LOG.error(e.getMessage(), e); + throw new RuntimeException(e); + } + } + + public ColumnInfo resolveColumn(Operator op, + ExprNodeColumnDesc desc) { + try { + ColumnInfo ci = null; + for (Operator parent : op.getParentOperators()) { + RowResolver rr = opToParseCtxMap.get(parent).getRowResolver(); + String[] tmp = rr.reverseLookup(desc.getColumn()); + if (tmp == null) { + LOG.debug("Reverse look up of column " + desc + " error!"); + return null; + } + ci = rr.get(tmp[0], tmp[1]); + return ci; + } + return null; + } catch (SemanticException e) { + throw new RuntimeException(e); + } + } + + public void addOpToDelete(Operator op) { + opToDelete.add(op); + } + + public List> getOpToDelete() { + return opToDelete; + } +} Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java (revision 1541356) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java (working copy) @@ -51,11 +51,15 @@ transformations = new ArrayList(); // Add the transformation that computes the lineage information. transformations.add(new Generator()); + if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTPPD)) { transformations.add(new PredicateTransitivePropagate()); transformations.add(new PredicatePushDown()); transformations.add(new PartitionPruner()); transformations.add(new PartitionConditionRemover()); + if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTCONSTANTPROG)) { + transformations.add(new ConstantPropagate()); + } if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTLISTBUCKETING)) { /* Add list bucketing pruner. */ transformations.add(new ListBucketingPruner()); Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagate.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagate.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagate.java (revision 0) @@ -0,0 +1,147 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.optimizer; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hive.ql.exec.Operator; +import org.apache.hadoop.hive.ql.lib.DefaultGraphWalker; +import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher; +import org.apache.hadoop.hive.ql.lib.Dispatcher; +import org.apache.hadoop.hive.ql.lib.GraphWalker; +import org.apache.hadoop.hive.ql.lib.Node; +import org.apache.hadoop.hive.ql.lib.NodeProcessor; +import org.apache.hadoop.hive.ql.lib.Rule; +import org.apache.hadoop.hive.ql.lib.RuleRegExp; +import org.apache.hadoop.hive.ql.parse.OpParseContext; +import org.apache.hadoop.hive.ql.parse.ParseContext; +import org.apache.hadoop.hive.ql.parse.SemanticException; +import org.apache.hadoop.hive.ql.plan.OperatorDesc; + +/** + * Implementation of one of the rule-based optimization steps. ConstantPropagate traverse the DAG + * from root to child. For each conditional expression, process as follows: + * + * 1. Fold constant expression: if the expression is a UDF and all parameters are constant. + * + * 2. Shortcut expression: if the expression is a logical operator and it can be shortcut by + * some constants of its parameters. + * + * 3. Propagate expression: if the expression contains half-deterministic segments like + * column=constant. + */ +public class ConstantPropagate implements Transform { + + private static final Log LOG = LogFactory.getLog(ConstantPropagate.class); + protected ParseContext pGraphContext; + private Map, OpParseContext> opToParseCtxMap; + + public ConstantPropagate() { + } + + /** + * Transform the query tree. + * + * @param pactx + * the current parse context + */ + public ParseContext transform(ParseContext pactx) throws SemanticException { + pGraphContext = pactx; + opToParseCtxMap = pGraphContext.getOpParseCtx(); + + // generate pruned column list for all relevant operators + ConstantPropagateProcCtx cppCtx = new ConstantPropagateProcCtx(opToParseCtxMap); + + // create a walker which walks the tree in a DFS manner while maintaining + // the operator stack. The dispatcher + // generates the plan from the operator tree + Map opRules = new LinkedHashMap(); + opRules.put(new RuleRegExp("R1", "FIL%"), ConstantPropagateProcFactory + .getFilterProc()); + opRules.put(new RuleRegExp("R2", "GBY%"), ConstantPropagateProcFactory + .getGroupByProc()); + opRules.put(new RuleRegExp("R3", "SEL%"), ConstantPropagateProcFactory + .getSelectProc()); + opRules.put(new RuleRegExp("R4", "FS%"), ConstantPropagateProcFactory + .getFileSinkProc()); + opRules.put(new RuleRegExp("R5", "UNION%"), ConstantPropagateProcFactory + .getUnionProc()); + opRules.put(new RuleRegExp("R5", "RS%"), ConstantPropagateProcFactory + .getReduceSinkProc()); + // The dispatcher fires the processor corresponding to the closest matching + // rule and passes the context along + Dispatcher disp = new DefaultRuleDispatcher(ConstantPropagateProcFactory + .getDefaultProc(), opRules, cppCtx); + GraphWalker ogw = new ConstantPropagateWalker(disp); + + // Create a list of topop nodes + ArrayList topNodes = new ArrayList(); + topNodes.addAll(pGraphContext.getTopOps().values()); + ogw.startWalking(topNodes, null); + for (Operator opToDelete : cppCtx.getOpToDelete()) { + if (opToDelete.getParentOperators() == null || opToDelete.getParentOperators().size() != 1) { + throw new RuntimeException("Error pruning operator " + opToDelete + + ". It should have only 1 parent."); + } + opToDelete.getParentOperators().get(0).removeChildAndAdoptItsChildren(opToDelete); + } + return pGraphContext; + } + + + /** + * Walks the op tree in root-first order. + */ + public static class ConstantPropagateWalker extends DefaultGraphWalker { + + public ConstantPropagateWalker(Dispatcher disp) { + super(disp); + } + + public void walk(Node nd) throws SemanticException { + + List parents = ((Operator) nd).getParentOperators(); + if ((parents == null) + || getDispatchedList().containsAll(parents)) { + opStack.push(nd); + // all children are done or no need to walk the children + dispatch(nd, opStack); + opStack.pop(); + } else { + getToWalk().removeAll(parents); + getToWalk().add(0, nd); + getToWalk().addAll(0, parents); + return; + } + // move all the children to the front of queue + List children = nd.getChildren(); + if (children != null) { + getToWalk().removeAll(children); + getToWalk().addAll(children); + } + } + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPrunerProcFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPrunerProcFactory.java (revision 1541356) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPrunerProcFactory.java (working copy) @@ -395,6 +395,9 @@ for (String childCol : childJoinCols) { ExprNodeDesc desc = exprMap.get(childCol); int index = conf.getValueCols().indexOf(desc); + if (index < 0) { + continue; + } flags[index] = true; String[] nm = redSinkRR.reverseLookup(childCol); if (nm != null) { @@ -557,7 +560,6 @@ Object... nodeOutputs) throws SemanticException { SelectOperator op = (SelectOperator) nd; ColumnPrunerProcCtx cppCtx = (ColumnPrunerProcCtx) ctx; - LateralViewJoinOperator lvJoin = null; if (op.getChildOperators() != null) { for (Operator child : op.getChildOperators()) { Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java (revision 0) @@ -0,0 +1,664 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.optimizer; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hive.ql.exec.ColumnInfo; +import org.apache.hadoop.hive.ql.exec.FileSinkOperator; +import org.apache.hadoop.hive.ql.exec.FilterOperator; +import org.apache.hadoop.hive.ql.exec.GroupByOperator; +import org.apache.hadoop.hive.ql.exec.JoinOperator; +import org.apache.hadoop.hive.ql.exec.Operator; +import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator; +import org.apache.hadoop.hive.ql.exec.RowSchema; +import org.apache.hadoop.hive.ql.exec.SelectOperator; +import org.apache.hadoop.hive.ql.exec.UnionOperator; +import org.apache.hadoop.hive.ql.lib.Node; +import org.apache.hadoop.hive.ql.lib.NodeProcessor; +import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.ql.parse.RowResolver; +import org.apache.hadoop.hive.ql.parse.SemanticException; +import org.apache.hadoop.hive.ql.plan.AggregationDesc; +import org.apache.hadoop.hive.ql.plan.DynamicPartitionCtx; +import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc; +import org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc; +import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; +import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; +import org.apache.hadoop.hive.ql.plan.ExprNodeNullDesc; +import org.apache.hadoop.hive.ql.plan.FileSinkDesc; +import org.apache.hadoop.hive.ql.plan.GroupByDesc; +import org.apache.hadoop.hive.ql.plan.JoinCondDesc; +import org.apache.hadoop.hive.ql.plan.JoinDesc; +import org.apache.hadoop.hive.ql.plan.ReduceSinkDesc; +import org.apache.hadoop.hive.ql.udf.UDFType; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDF; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredJavaObject; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqual; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNull; +import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPOr; +import org.apache.hadoop.hive.serde.serdeConstants; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.Converter; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils; +import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory; +import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; +import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; +import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; +import org.apache.hadoop.io.Writable; + +/** + * Factory for generating the different node processors used by ConstantPropagate. + */ +public final class ConstantPropagateProcFactory { + protected static final Log LOG = LogFactory.getLog(ConstantPropagateProcFactory.class.getName()); + protected static Set> propagatableUdfs = new HashSet>(); + + static { + propagatableUdfs.add(GenericUDFOPAnd.class); + }; + + + private ConstantPropagateProcFactory() { + // prevent instantiation + } + + private static ExprNodeConstantDesc typeCast(ExprNodeDesc desc, TypeInfo ti) { + LOG.debug("Casting " + desc + " to type " + ti); + PrimitiveTypeInfo priti = (PrimitiveTypeInfo) ti; + if (priti.getPrimitiveCategory() == PrimitiveCategory.DECIMAL + || priti.getPrimitiveCategory() == PrimitiveCategory.VARCHAR) { + // FIXME: not support template types. + return null; + } + ExprNodeConstantDesc c = (ExprNodeConstantDesc) desc; + ObjectInspector origOI = TypeInfoUtils + .getStandardJavaObjectInspectorFromTypeInfo(desc.getTypeInfo()); + ObjectInspector oi = TypeInfoUtils + .getStandardJavaObjectInspectorFromTypeInfo(desc.getTypeInfo()); + Converter converter = ObjectInspectorConverters.getConverter(oi, origOI); + Object convObj = converter.convert(c.getValue()); + return new ExprNodeConstantDesc(ti, convObj); + } + + public static ExprNodeDesc foldExpr(ExprNodeDesc desc, + Map constants, + ConstantPropagateProcCtx cppCtx, Operator op, boolean propagate) { + if (desc instanceof ExprNodeGenericFuncDesc) { + ExprNodeGenericFuncDesc funcDesc = (ExprNodeGenericFuncDesc) desc; + // The function must be deterministic + GenericUDF udf = funcDesc.getGenericUDF(); + if (!isDeterministicUdf(udf)) { + LOG.debug("Funtion " + udf.getClass() + " undeterministic, quit foding."); + return desc; + } + + boolean propagateNext = propagate; + if (!propagatableUdfs.contains(udf.getClass())) { + propagateNext = false; + } + List newExprs = new ArrayList(); + for (ExprNodeDesc childExpr : desc.getChildren()) { + newExprs.add(foldExpr(childExpr, constants, cppCtx, op, propagateNext)); + } + // If all child expressions are constants, calculate immediately + ExprNodeDesc constant = evaluateFunction(udf, newExprs, desc.getChildren()); + if (constant != null) { + LOG.debug("Folding expression:" + desc + " -> " + constant); + return constant; + } else { + // Check if the function can be short cut. + ExprNodeDesc shortcut = shortcutFunction(udf, newExprs); + if (shortcut != null) { + LOG.debug("Folding expression:" + desc + " -> " + shortcut); + return shortcut; + } + ((ExprNodeGenericFuncDesc) desc).setChildren(newExprs); + } + // If in some selected binary operators (=, is null, etc), one of the expressions are + // constant, add them to colToConstatns as half-deterministic columns. + if (propagate) { + propagate(udf, newExprs, cppCtx, op, constants); + } + + return desc; + } else if (desc instanceof ExprNodeColumnDesc) { + // ColumnDesc is resolved by input RowResolver. + ExprNodeDesc col = evaluateColumn((ExprNodeColumnDesc) desc, cppCtx, op); + LOG.debug("Folding expression:" + desc + " -> " + col); + return col; + } else { + LOG.debug("Unrecognizable node, quit folding expression " + desc); + return desc; + } + } + + private static boolean isDeterministicUdf(GenericUDF udf) { + UDFType udfType = udf.getClass().getAnnotation(UDFType.class); + if (udf instanceof GenericUDFBridge) { + udfType = ((GenericUDFBridge) udf).getUdfClass().getAnnotation(UDFType.class); + } + return udfType.deterministic(); + } + + private static void propagate(GenericUDF udf, List newExprs, + ConstantPropagateProcCtx cppCtx, Operator op, + Map constants) { + if (udf instanceof GenericUDFOPEqual) { + ExprNodeDesc lOperand = newExprs.get(0); + ExprNodeDesc rOperand = newExprs.get(1); + if (lOperand instanceof ExprNodeColumnDesc && rOperand instanceof ExprNodeConstantDesc) { + LOG.debug("Filter " + udf + + " is identified as a value assignment, propagate it."); + ExprNodeColumnDesc c = (ExprNodeColumnDesc) lOperand; + ExprNodeConstantDesc v = (ExprNodeConstantDesc) rOperand; + ColumnInfo ci = cppCtx.resolveColumn(op, c); + if (ci != null) { + constants.put(ci, v); + } + } + } else if (udf instanceof GenericUDFOPNull) { + ExprNodeDesc operand = newExprs.get(0); + if (operand instanceof ExprNodeColumnDesc) { + LOG.debug("Filter " + udf + + " is identified as a value assignment, propagate it."); + ExprNodeColumnDesc c = (ExprNodeColumnDesc) operand; + ColumnInfo ci = cppCtx.resolveColumn(op, c); + if (ci != null) { + constants.put(ci, new ExprNodeNullDesc()); + } + } + } + } + + private static ExprNodeDesc shortcutFunction(GenericUDF udf, List newExprs) { + if (udf instanceof GenericUDFOPAnd) { + for (int i = 0; i < 2; i++) { + ExprNodeDesc childExpr = newExprs.get(i); + if (childExpr instanceof ExprNodeConstantDesc) { + ExprNodeConstantDesc c = (ExprNodeConstantDesc) childExpr; + if (c.getValue() == Boolean.TRUE) { + // if true, prune it + return newExprs.get(Math.abs(i - 1)); + } else { + // if false return false + return childExpr; + } + } + } + } + + if (udf instanceof GenericUDFOPOr) { + for (int i = 0; i < 2; i++) { + ExprNodeDesc childExpr = newExprs.get(i); + if (childExpr instanceof ExprNodeConstantDesc) { + ExprNodeConstantDesc c = (ExprNodeConstantDesc) childExpr; + if (c.getValue() == Boolean.FALSE) { + // if false, prune it + return newExprs.get(Math.abs(i - 1)); + } else { + // if true return true + return childExpr; + } + } + } + } + + return null; + } + + /** + * + * @param desc + * @param ctx + * @param op + * @param colToConstants + * @return + */ + private static ExprNodeDesc evaluateColumn(ExprNodeColumnDesc desc, + ConstantPropagateProcCtx cppCtx, Operator op) { + try { + ColumnInfo ci = null; + for (Operator parent : op.getParentOperators()) { + RowResolver rr = cppCtx.getOpToParseCtxMap().get(parent).getRowResolver(); + String[] tmp = rr.reverseLookup(desc.getColumn()); + if (tmp == null) { + LOG.debug("Reverse look up of column " + desc + " error!"); + return desc; + } + ci = rr.get(tmp[0], tmp[1]); + if (ci != null) { + LOG.debug("Resolved ColumnInfo " + ci); + ExprNodeDesc constant = cppCtx.getOpToConstantExprs().get(parent).get(ci); + if (constant != null) { + LOG.debug("Fold column " + ci + " to be " + constant); + if (constant instanceof ExprNodeConstantDesc + && !constant.getTypeInfo().equals(desc.getTypeInfo())) { + // Need convert type + ExprNodeDesc expr = typeCast(constant, desc.getTypeInfo()); + if (expr == null) { + return desc; + } else { + return expr; + } + } + return constant; + } else { + return desc; + } + } + LOG.debug("Can't resolve " + desc.getTabAlias() + "." + desc.getColumn() + " from rr " + rr + + " of op " + parent); + } + // assert ci != null; + return desc; // suppose never go to here. + } catch (SemanticException e) { + throw new RuntimeException(e); + } + + } + + /** + * + * @param udf + * UDF object + * @param exprs + * @param oldExprs + * @return null if expression cannot be evaluated (not all parameters are constants). Or evaluated + * ExprNodeConstantDesc if possible. + * @throws HiveException + */ + private static ExprNodeDesc evaluateFunction(GenericUDF udf, List exprs, + List oldExprs) { + DeferredJavaObject[] arguments = new DeferredJavaObject[exprs.size()]; + ObjectInspector[] argois = new ObjectInspector[exprs.size()]; + for (int i = 0; i < exprs.size(); i++) { + ExprNodeDesc desc = exprs.get(i); + if (desc instanceof ExprNodeConstantDesc) { + ExprNodeConstantDesc constant = (ExprNodeConstantDesc) exprs.get(i); + if (!constant.getTypeInfo().equals(oldExprs.get(i).getTypeInfo())) { + constant = typeCast(constant, oldExprs.get(i).getTypeInfo()); + if (constant == null) { + return null; + } + } + Object value = constant.getValue(); + PrimitiveTypeInfo pti = (PrimitiveTypeInfo) constant.getTypeInfo(); + Object writableValue = PrimitiveObjectInspectorFactory + .getPrimitiveJavaObjectInspector(pti).getPrimitiveWritableObject( + value); + arguments[i] = new DeferredJavaObject(writableValue); + argois[i] = ObjectInspectorUtils.getConstantObjectInspector( + constant.getWritableObjectInspector(), writableValue); + } else if (desc instanceof ExprNodeNullDesc) { + // FIXME: add null support. + return null; + } else { + return null; + } + } + + try { + ObjectInspector oi = udf.initialize(argois); + Object o = udf.evaluate(arguments); + LOG.debug(udf.getClass().getName() + "(" + exprs + ")=" + o); + if (o == null) { + return new ExprNodeNullDesc(); + } + Class clz = o.getClass(); + if (PrimitiveObjectInspectorUtils.isPrimitiveWritableClass(clz)) { + PrimitiveObjectInspector poi = (PrimitiveObjectInspector) oi; + TypeInfo typeInfo = poi.getTypeInfo(); + // Handling parameterized types (varchar, decimal, etc). + if (typeInfo.getTypeName().contains(serdeConstants.DECIMAL_TYPE_NAME) + || typeInfo.getTypeName().contains(serdeConstants.VARCHAR_TYPE_NAME)) { + // Do not support parameterized types. + return null; + } + o = poi.getPrimitiveJavaObject(o); + } else if (PrimitiveObjectInspectorUtils.isPrimitiveJavaClass(clz)) { + + } else { + LOG.error("Unable to evaluate " + udf + ". Return value unrecoginizable."); + return null; + } + return new ExprNodeConstantDesc(o); + } catch (HiveException e) { + LOG.error("Evaluation function " + udf.getClass() + + " failed in Constant Propagatation Optimizer."); + throw new RuntimeException(e); + } + } + + private static void foldOperator( + Operator op, + Map constants) + throws SemanticException { + // the pruning needs to preserve the order of columns in the input schema + RowSchema schema = op.getSchema(); + if (schema != null) { + ArrayList cols = schema.getSignature(); + for (int i = 0; i < cols.size(); i++) { + ColumnInfo col = cols.get(i); + ExprNodeDesc constant = constants.get(col); + if (constant != null) { + LOG.debug("Replacing column " + col + " with constant " + + constant.getExprString() + " in " + op); + // ObjectInspector o = ObjectInspectorUtils.getConstantObjectInspector( + // constant.getWritableObjectInspector(), constant.getValue()); + col.setObjectinspector(constant.getWritableObjectInspector()); + } + } + } + } + + /** + * Node Processor for Column Pruning on Filter Operators. + */ + public static class ConstantPropagateFilterProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + FilterOperator op = (FilterOperator) nd; + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + ExprNodeDesc condn = op.getConf().getPredicate(); + // Fold constants + Map constants = cppCtx.getPropagatedConstants(op); + LOG.debug("Old filter conditions:" + condn.getExprString()); + ExprNodeDesc newCondn = foldExpr(condn, constants, cppCtx, op, true); + if (newCondn instanceof ExprNodeConstantDesc) { + ExprNodeConstantDesc c = (ExprNodeConstantDesc) newCondn; + if (c.getValue() == Boolean.TRUE) { + cppCtx.addOpToDelete(op); + LOG.debug("Filter expression " + condn + " hold true. Will delete it."); + } else if (c.getValue() == Boolean.FALSE) { + LOG.warn("Filter expression " + condn + " hold false!"); + } + } + LOG.debug("New filter conditions:" + newCondn.getExprString()); + // merge it with the downstream col list + cppCtx.getOpToConstantExprs().put(op, constants); + op.getConf().setPredicate(newCondn); + foldOperator(op, constants); + return null; + } + + } + + /** + * Factory method to get the ConstantPropagateFilterProc class. + * + * @return ConstantPropagateFilterProc + */ + public static ConstantPropagateFilterProc getFilterProc() { + return new ConstantPropagateFilterProc(); + } + + /** + * Node Processor for Column Pruning on Group By Operators. + */ + public static class ConstantPropagateGroupByProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + GroupByOperator op = (GroupByOperator) nd; + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + GroupByDesc conf = op.getConf(); + ArrayList keys = conf.getKeys(); + + Map colToConstants = cppCtx.getPropagatedConstants(op); + for (int i = 0; i < keys.size(); i++) { + ExprNodeDesc key = keys.get(i); + ExprNodeDesc newkey = foldExpr(key, colToConstants, cppCtx, op, true); + keys.set(i, newkey); + } + + ArrayList aggrs = conf.getAggregators(); + for (AggregationDesc aggr : aggrs) { + // TODO: + } + + cppCtx.getOpToConstantExprs().put(op, colToConstants); + + foldOperator(op, colToConstants); + return null; + } + } + + /** + * Factory method to get the ConstantPropagateGroupByProc class. + * + * @return ConstantPropagateGroupByProc + */ + public static ConstantPropagateGroupByProc getGroupByProc() { + return new ConstantPropagateGroupByProc(); + } + + /** + * The Default Node Processor for Column Pruning. + */ + public static class ConstantPropagateDefaultProc implements NodeProcessor { + @SuppressWarnings("unchecked") + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + Operator op = (Operator) nd; + Map constants = cppCtx.getPropagatedConstants(op); + cppCtx.getOpToConstantExprs().put(op, constants); + foldOperator(op, constants); + return null; + } + } + + /** + * Factory method to get the ConstantPropagateDefaultProc class. + * + * @return ConstantPropagateDefaultProc + */ + public static ConstantPropagateDefaultProc getDefaultProc() { + return new ConstantPropagateDefaultProc(); + } + + /** + * The Node Processor for Column Pruning on Select Operators. + */ + public static class ConstantPropagateSelectProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + SelectOperator op = (SelectOperator) nd; + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + Map constants = cppCtx.getPropagatedConstants(op); + cppCtx.getOpToConstantExprs().put(op, constants); + List colList = op.getConf().getColList(); + if (colList != null) { + for (int i = 0; i < colList.size(); i++) { + ExprNodeDesc newCol = foldExpr(colList.get(i), constants, cppCtx, op, false); + colList.set(i, newCol); + } + } + foldOperator(op, constants); + LOG.debug("New column list:(" + StringUtils.join(colList, " ") + ")"); + return null; + } + } + + /** + * The Factory method to get the ConstantPropagateSelectProc class. + * + * @return ConstantPropagateSelectProc + */ + public static ConstantPropagateSelectProc getSelectProc() { + return new ConstantPropagateSelectProc(); + } + + /** + * The Node Processor for constant propagation on FileSink Operators. Addition to constant + * propagate, this processor also prune dynamic partition to static partition if possible. + */ + public static class ConstantPropagateFileSinkProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + FileSinkOperator op = (FileSinkOperator) nd; + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + Map constants = cppCtx.getPropagatedConstants(op); + cppCtx.getOpToConstantExprs().put(op, constants); + foldOperator(op, constants); + FileSinkDesc fsdesc = op.getConf(); + DynamicPartitionCtx dpCtx = fsdesc.getDynPartCtx(); + if (dpCtx != null) { + // If all dynamic partitions are propagated as constant, remove DP. + Set inputs = dpCtx.getInputToDPCols().keySet(); + // Suppose only 1 parent for FS operator + Operator parent = op.getParentOperators().get(0); + Map parentConstants = cppCtx + .getPropagatedConstants(parent); + RowResolver rr = cppCtx.getOpToParseCtxMap().get(parent).getRowResolver(); + boolean allConstant = true; + for (String input : inputs) { + String tmp[] = rr.reverseLookup(input); + ColumnInfo ci = rr.get(tmp[0], tmp[1]); + if (parentConstants.get(ci) == null) { + allConstant = false; + break; + } + } + if (allConstant) { + pruneDP(fsdesc); + } + } + return null; + } + + private void pruneDP(FileSinkDesc fsdesc) { + // Warn only. + LOG.info("DP can be rewrite to SP!"); + // fsdesc.setDynPartCtx(null); + // fsdesc.setDirName(dirName); + } + } + + public static NodeProcessor getFileSinkProc() { + return new ConstantPropagateFileSinkProc(); + } + + /** + * The Node Processor for Constant Propatation on Union Operators. + */ + public static class ConstantPropagateUnionProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + UnionOperator op = (UnionOperator) nd; + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + cppCtx.getOpToConstantExprs().put(op, new HashMap()); + return null; + } + } + + public static NodeProcessor getUnionProc() { + return new ConstantPropagateUnionProc(); + } + + public static class ConstantPropagateReduceSinkProc implements NodeProcessor { + public Object process(Node nd, Stack stack, NodeProcessorCtx ctx, + Object... nodeOutputs) throws SemanticException { + ReduceSinkOperator op = (ReduceSinkOperator) nd; + ReduceSinkDesc rsDesc = op.getConf(); + ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; + Map constants = cppCtx.getPropagatedConstants(op); + + if (op.getChildOperators().size() == 1 + && op.getChildOperators().get(0) instanceof JoinOperator) { + JoinOperator joinOp = (JoinOperator) op.getChildOperators().get(0); + if (skipFolding(joinOp.getConf(), op.getConf().getTag())) { + LOG.debug("Outer join in the future, skip folding " + op + "."); + cppCtx.getOpToConstantExprs().put(op, new HashMap()); + return null; + } + } + // key columns + ArrayList newKeyExprs = new ArrayList(); + for (ExprNodeDesc desc : rsDesc.getKeyCols()) { + newKeyExprs.add(foldExpr(desc, constants, cppCtx, op, false)); + } + rsDesc.setKeyCols(newKeyExprs); + + // partition columns + ArrayList newPartExprs = new ArrayList(); + for (ExprNodeDesc desc : rsDesc.getPartitionCols()) { + newPartExprs.add(foldExpr(desc, constants, cppCtx, op, false)); + } + rsDesc.setPartitionCols(newPartExprs); + + // value columns + ArrayList newValExprs = new ArrayList(); + for (ExprNodeDesc desc : rsDesc.getValueCols()) { + newValExprs.add(foldExpr(desc, constants, cppCtx, op, false)); + } + rsDesc.setValueCols(newValExprs); + + foldOperator(op, constants); + cppCtx.getOpToConstantExprs().put(op, constants); + return null; + } + + private boolean skipFolding(JoinDesc joinDesc, int tag) { + JoinCondDesc[] conds = joinDesc.getConds(); + int i; + for (i = conds.length - 1; i >= 0; i--) { + if (conds[i].getType() == JoinDesc.INNER_JOIN) { + if (tag == i + 1) + return false; + } else if (conds[i].getType() == JoinDesc.FULL_OUTER_JOIN) { + return true; + } else if (conds[i].getType() == JoinDesc.RIGHT_OUTER_JOIN) { + if (tag == i + 1) + return false; + return true; + } else if (conds[i].getType() == JoinDesc.LEFT_OUTER_JOIN) { + if (tag == i + 1) + return true; + } + } + if (tag == 0) { + return false; + } + return true; + } + } + + public static NodeProcessor getReduceSinkProc() { + return new ConstantPropagateReduceSinkProc(); + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnInfo.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnInfo.java (revision 1541356) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnInfo.java (working copy) @@ -20,6 +20,7 @@ import java.io.Serializable; +import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; @@ -215,4 +216,8 @@ return true; } + + public void setObjectinspector(ObjectInspector oi) { + this.objectInspector = oi; + } } Index: ql/src/test/queries/clientpositive/constprog2.q =================================================================== --- ql/src/test/queries/clientpositive/constprog2.q (revision 0) +++ ql/src/test/queries/clientpositive/constprog2.q (revision 0) @@ -0,0 +1,10 @@ +set hive.fetch.task.conversion=more; +set hive.optimize.constant.propagation=true; + +EXPLAIN +SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86; + +SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86; + Index: ql/src/test/queries/clientpositive/constprog_dp.q =================================================================== --- ql/src/test/queries/clientpositive/constprog_dp.q (revision 0) +++ ql/src/test/queries/clientpositive/constprog_dp.q (revision 0) @@ -0,0 +1,11 @@ +set hive.optimize.constant.propagation=true; +set hive.exec.dynamic.partition.mode=nonstrict; + +create table dest(key string, value string) partitioned by (ds string); + +EXPLAIN +from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08'; + +from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08'; Index: ql/src/test/queries/clientpositive/constprog1.q =================================================================== --- ql/src/test/queries/clientpositive/constprog1.q (revision 0) +++ ql/src/test/queries/clientpositive/constprog1.q (revision 0) @@ -0,0 +1,9 @@ +set hive.fetch.task.conversion=more; +set hive.optimize.constant.propagation=true; + +EXPLAIN +SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows); + +SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows); Index: ql/src/test/results/clientpositive/udf_if.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_if.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_if.q.out (working copy) @@ -42,15 +42,15 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: if(true, 1, 2) + expr: 1 type: int - expr: if(false, UDFToString(null), UDFToString(1)) + expr: if(false, UDFToString(null), '1') type: string - expr: if((1 = 1), if((2 = 2), 1, 2), if((3 = 3), 3, 4)) + expr: 1 type: int - expr: if((2 = 2), 1, null) + expr: if(true, 1, null) type: int - expr: if((2 = 2), null, 1) + expr: if(true, null, 1) type: int expr: if(if(true, null, false), 1, 2) type: int @@ -111,13 +111,13 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: if(true, UDFToShort(128), UDFToByte(1)) + expr: 128 type: smallint - expr: if(false, 1, 1.1) + expr: 1.1 type: double - expr: if(false, 1, 'ABC') + expr: 'ABC' type: string - expr: if(false, 'ABC', 12.3) + expr: '12.3' type: string outputColumnNames: _col0, _col1, _col2, _col3 ListSink Index: ql/src/test/results/clientpositive/create_view.q.out =================================================================== --- ql/src/test/results/clientpositive/create_view.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/create_view.q.out (working copy) @@ -191,7 +191,7 @@ type: boolean Select Operator expressions: - expr: key + expr: '18' type: string expr: value type: string Index: ql/src/test/results/clientpositive/udf_elt.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_elt.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_elt.q.out (working copy) @@ -55,28 +55,28 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: elt(2, 'abc', 'defg') + expr: 'defg' type: string - expr: elt(3, 'aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg') + expr: 'cc' type: string - expr: elt('1', 'abc', 'defg') + expr: 'abc' type: string - expr: elt(2, 'aa', UDFToByte('2')) + expr: '2' type: string - expr: elt(2, 'aa', UDFToShort('12345')) + expr: '12345' type: string - expr: elt(2, 'aa', UDFToLong('123456789012')) + expr: '123456789012' type: string - expr: elt(2, 'aa', UDFToFloat(1.25)) + expr: '1.25' type: string - expr: elt(2, 'aa', 16.0) + expr: '16.0' type: string expr: elt(null, 'abc', 'defg') type: string - expr: elt(0, 'abc', 'defg') - type: string - expr: elt(3, 'abc', 'defg') - type: string + expr: null + type: void + expr: null + type: void outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 ListSink Index: ql/src/test/results/clientpositive/udf5.q.out =================================================================== --- ql/src/test/results/clientpositive/udf5.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf5.q.out (working copy) @@ -35,21 +35,21 @@ alias: dest1 Select Operator expressions: - expr: from_unixtime(1226446340) + expr: '2008-11-11 15:32:20' type: string - expr: to_date(from_unixtime(1226446340)) + expr: '2008-11-11' type: string - expr: day('2008-11-01') + expr: 1 type: int - expr: month('2008-11-01') + expr: 11 type: int - expr: year('2008-11-01') + expr: 2008 type: int - expr: day('2008-11-01 15:32:20') + expr: 1 type: int - expr: month('2008-11-01 15:32:20') + expr: 11 type: int - expr: year('2008-11-01 15:32:20') + expr: 2008 type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 File Output Operator Index: ql/src/test/results/clientpositive/smb_mapjoin_18.q.out =================================================================== --- ql/src/test/results/clientpositive/smb_mapjoin_18.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/smb_mapjoin_18.q.out (working copy) @@ -290,19 +290,33 @@ type: boolean Select Operator expressions: - expr: key - type: int expr: value type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.test_table2 + outputColumnNames: _col1 + Reduce Output Operator + key expressions: + expr: 238 + type: int + sort order: + + Map-reduce partition columns: + expr: 238 + type: int + tag: -1 + value expressions: + expr: 238 + type: int + expr: _col1 + type: string + Reduce Operator Tree: + Extract + File Output Operator + compressed: false + GlobalTableId: 1 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.test_table2 Stage: Stage-0 Move Operator Index: ql/src/test/results/clientpositive/union_ppr.q.out =================================================================== --- ql/src/test/results/clientpositive/union_ppr.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/union_ppr.q.out (working copy) @@ -54,18 +54,16 @@ type: string expr: _col1 type: string - expr: _col2 - type: string expr: _col3 type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col1, _col3 Reduce Output Operator key expressions: expr: _col0 type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -76,7 +74,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -107,18 +105,16 @@ type: string expr: _col1 type: string - expr: _col2 - type: string expr: _col3 type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col1, _col3 Reduce Output Operator key expressions: expr: _col0 type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -129,7 +125,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string Index: ql/src/test/results/clientpositive/udf_case.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_case.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_case.q.out (working copy) @@ -80,17 +80,17 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: CASE (1) WHEN (1) THEN (2) WHEN (3) THEN (4) ELSE (5) END + expr: 2 type: int - expr: CASE (2) WHEN (1) THEN (2) ELSE (5) END + expr: 5 type: int - expr: CASE (14) WHEN (12) THEN (13) WHEN (14) THEN (15) END + expr: 15 type: int - expr: CASE (16) WHEN (12) THEN (13) WHEN (14) THEN (15) END - type: int + expr: null + type: void expr: CASE (17) WHEN (18) THEN (null) WHEN (17) THEN (20) END type: int - expr: CASE (21) WHEN (22) THEN (23) WHEN (21) THEN (24) END + expr: 24 type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 ListSink Index: ql/src/test/results/clientpositive/udf_radians.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_radians.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_radians.q.out (working copy) @@ -20,7 +20,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: radians(57.2958) + expr: 1.000000357564167 type: double outputColumnNames: _col0 ListSink @@ -80,7 +80,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: radians(57.2958) + expr: 1.000000357564167 type: double outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/literal_double.q.out =================================================================== --- ql/src/test/results/clientpositive/literal_double.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/literal_double.q.out (working copy) @@ -19,15 +19,15 @@ expressions: expr: 3.14 type: double - expr: (- 3.14) + expr: -3.14 type: double expr: 3.14E8 type: double expr: 3.14E-8 type: double - expr: (- 3.14E8) + expr: -3.14E8 type: double - expr: (- 3.14E-8) + expr: -3.14E-8 type: double expr: 3.14E8 type: double Index: ql/src/test/results/clientpositive/input23.q.out =================================================================== --- ql/src/test/results/clientpositive/input23.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input23.q.out (working copy) @@ -27,10 +27,6 @@ type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string b TableScan alias: b @@ -48,10 +44,6 @@ type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string Path -> Alias: #### A masked pattern was here #### Path -> Partition: @@ -105,27 +97,27 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} + 0 {VALUE._col0} {VALUE._col1} + 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3, _col6, _col7, _col8, _col9 + outputColumnNames: _col0, _col1, _col6, _col7 Select Operator expressions: expr: _col0 type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string - expr: _col3 + expr: '11' type: string expr: _col6 type: string expr: _col7 type: string - expr: _col8 + expr: '2008-04-08' type: string - expr: _col9 + expr: '14' type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 Limit Index: ql/src/test/results/clientpositive/infer_const_type.q.out =================================================================== --- ql/src/test/results/clientpositive/infer_const_type.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/infer_const_type.q.out (working copy) @@ -62,20 +62,20 @@ type: boolean Select Operator expressions: - expr: ti + expr: 127 type: tinyint - expr: si + expr: 32767 type: smallint - expr: i + expr: 12345 type: int - expr: bi + expr: -12345 type: bigint - expr: fl + expr: 906.0 type: float - expr: db + expr: -307.0 type: double - expr: str - type: string + expr: 1234 + type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 File Output Operator compressed: false @@ -151,7 +151,7 @@ alias: infertypes Filter Operator predicate: - expr: (((((false or false) or false) or false) or false) or false) + expr: false type: boolean Select Operator expressions: @@ -231,7 +231,7 @@ alias: infertypes Filter Operator predicate: - expr: ((false or false) or false) + expr: false type: boolean Select Operator expressions: @@ -319,8 +319,8 @@ type: float expr: db type: double - expr: str - type: string + expr: 1.57 + type: double outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 File Output Operator compressed: false Index: ql/src/test/results/clientpositive/transform_ppr2.q.out =================================================================== --- ql/src/test/results/clientpositive/transform_ppr2.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/transform_ppr2.q.out (working copy) @@ -35,7 +35,7 @@ GatherStats: false Select Operator expressions: - expr: ds + expr: '2008-04-08' type: string expr: key type: string @@ -69,7 +69,7 @@ type: string tag: -1 value expressions: - expr: _col0 + expr: '2008-04-08' type: string expr: _col1 type: string Index: ql/src/test/results/clientpositive/cluster.q.out =================================================================== --- ql/src/test/results/clientpositive/cluster.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/cluster.q.out (working copy) @@ -24,23 +24,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 10 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 10 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 10 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -93,23 +91,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -162,23 +158,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -231,23 +225,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -300,23 +292,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -369,23 +359,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -438,11 +426,9 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: expr: _col1 @@ -453,8 +439,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -530,8 +516,8 @@ type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string outputColumnNames: _col0, _col1 @@ -592,8 +578,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -620,19 +604,17 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4 + outputColumnNames: _col1, _col4 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -656,8 +638,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 @@ -721,8 +703,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -751,21 +731,19 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5 + outputColumnNames: _col1, _col4, _col5 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string expr: _col5 type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col1, _col2, _col3 File Output Operator compressed: false GlobalTableId: 0 @@ -789,8 +767,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 @@ -856,8 +834,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -886,21 +862,19 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5 + outputColumnNames: _col1, _col4, _col5 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string expr: _col5 type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col1, _col2, _col3 File Output Operator compressed: false GlobalTableId: 0 @@ -916,16 +890,16 @@ TableScan Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 @@ -991,8 +965,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -1019,19 +991,17 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4 + outputColumnNames: _col1, _col4 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -1047,16 +1017,16 @@ TableScan Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 20 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 20 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 Index: ql/src/test/results/clientpositive/index_auto_multiple.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_multiple.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_multiple.q.out (working copy) @@ -120,20 +120,18 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 86 + type: int sort order: + tag: -1 value expressions: - expr: _col0 - type: string + expr: 86 + type: int expr: _col1 type: string Reduce Operator Tree: Index: ql/src/test/results/clientpositive/input_part9.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part9.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part9.q.out (working copy) @@ -28,13 +28,11 @@ expressions: expr: key type: string - expr: value - type: string - expr: ds - type: string expr: hr type: string - outputColumnNames: _col0, _col1, _col2, _col3 + expr: value + type: string + outputColumnNames: _col0, _col3, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -48,7 +46,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string Index: ql/src/test/results/clientpositive/udf_second.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_second.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_second.q.out (working copy) @@ -41,12 +41,12 @@ type: boolean Select Operator expressions: - expr: second('2009-08-07 13:14:15') + expr: 15 type: int - expr: second('13:14:15') + expr: 15 type: int - expr: second('2009-08-07') - type: int + expr: null + type: void outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/udf_E.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_E.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_E.q.out (working copy) @@ -20,7 +20,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: e() + expr: 2.718281828459045 type: double outputColumnNames: _col0 ListSink @@ -71,7 +71,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: e() + expr: 2.718281828459045 type: double outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/multi_insert_move_tasks_share_dependencies.q.out =================================================================== --- ql/src/test/results/clientpositive/multi_insert_move_tasks_share_dependencies.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/multi_insert_move_tasks_share_dependencies.q.out (working copy) @@ -3652,8 +3652,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3670,8 +3670,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3688,8 +3688,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3830,8 +3830,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3848,8 +3848,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3866,8 +3866,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4008,8 +4008,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4026,8 +4026,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4044,8 +4044,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4186,8 +4186,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4204,8 +4204,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4222,8 +4222,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/input_part4.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part4.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part4.q.out (working copy) @@ -27,10 +27,10 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr - type: string + expr: 15 + type: int outputColumnNames: _col0, _col1, _col2, _col3 ListSink Index: ql/src/test/results/clientpositive/auto_join8.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join8.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/auto_join8.q.out (working copy) @@ -113,7 +113,7 @@ type: int expr: _col1 type: string - expr: UDFToInteger(_col2) + expr: UDFToInteger(null) type: int expr: _col3 type: string Index: ql/src/test/results/clientpositive/udf7.q.out =================================================================== --- ql/src/test/results/clientpositive/udf7.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf7.q.out (working copy) @@ -49,56 +49,56 @@ alias: dest1 Select Operator expressions: - expr: round(ln(3.0), 12) + expr: 1.098612288668 type: double - expr: ln(0.0) + expr: null + type: void + expr: null + type: void + expr: 1.098612288668 type: double - expr: ln((- 1)) + expr: null + type: void + expr: null + type: void + expr: 1.584962500721 type: double - expr: round(log(3.0), 12) + expr: null + type: void + expr: null + type: void + expr: 0.47712125472 type: double - expr: log(0.0) + expr: null + type: void + expr: null + type: void + expr: 1.584962500721 type: double - expr: log((- 1)) + expr: null + type: void + expr: null + type: void + expr: null + type: void + expr: -1.0 type: double - expr: round(log2(3.0), 12) + expr: 7.389056098931 type: double - expr: log2(0.0) + expr: 8.0 type: double - expr: log2((- 1)) + expr: 8.0 type: double - expr: round(log10(3.0), 12) + expr: 0.125 type: double - expr: log10(0.0) + expr: 8.0 type: double - expr: log10((- 1)) + expr: 2.0 type: double - expr: round(log(2, 3.0), 12) + expr: NaN type: double - expr: log(2, 0.0) + expr: 1.0 type: double - expr: log(2, (- 1)) - type: double - expr: log(0.5, 2) - type: double - expr: log(2, 0.5) - type: double - expr: round(exp(2.0), 12) - type: double - expr: pow(2, 3) - type: double - expr: power(2, 3) - type: double - expr: power(2, (- 3)) - type: double - expr: power(0.5, (- 3)) - type: double - expr: power(4, 0.5) - type: double - expr: power((- 1), 0.5) - type: double - expr: power((- 1), 2) - type: double expr: power(CAST( 1 AS decimal(10,0)), 0) type: decimal(65,30) expr: power(CAST( 2 AS decimal(10,0)), 3) Index: ql/src/test/results/clientpositive/pcr.q.out =================================================================== --- ql/src/test/results/clientpositive/pcr.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/pcr.q.out (working copy) @@ -1476,21 +1476,19 @@ type: boolean Select Operator expressions: - expr: key - type: int expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 + expr: 14 type: int expr: _col1 type: string sort order: ++ tag: -1 value expressions: - expr: _col0 + expr: 14 type: int expr: _col1 type: string @@ -2365,8 +2363,6 @@ type: int expr: value type: string - expr: ds - type: string t2 TableScan alias: t2 @@ -2385,8 +2381,6 @@ type: int expr: value type: string - expr: ds - type: string Path -> Alias: #### A masked pattern was here #### Path -> Partition: @@ -2439,25 +2433,21 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} + 0 {VALUE._col0} {VALUE._col1} + 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7 + outputColumnNames: _col0, _col1, _col5, _col6 Select Operator expressions: expr: _col0 type: int expr: _col1 type: string - expr: _col2 - type: string expr: _col5 type: int expr: _col6 type: string - expr: _col7 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + outputColumnNames: _col0, _col1, _col3, _col4 File Output Operator compressed: false GlobalTableId: 0 @@ -2467,8 +2457,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -2493,13 +2483,13 @@ type: int expr: _col1 type: string - expr: _col2 + expr: '2000-04-08' type: string expr: _col3 type: int expr: _col4 type: string - expr: _col5 + expr: '2000-04-08' type: string Path -> Alias: #### A masked pattern was here #### @@ -2510,8 +2500,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -2519,8 +2509,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -2649,8 +2639,6 @@ type: int expr: value type: string - expr: ds - type: string t2 TableScan alias: t2 @@ -2669,8 +2657,6 @@ type: int expr: value type: string - expr: ds - type: string Path -> Alias: #### A masked pattern was here #### Path -> Partition: @@ -2765,25 +2751,21 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} + 0 {VALUE._col0} {VALUE._col1} + 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7 + outputColumnNames: _col0, _col1, _col5, _col6 Select Operator expressions: expr: _col0 type: int expr: _col1 type: string - expr: _col2 - type: string expr: _col5 type: int expr: _col6 type: string - expr: _col7 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + outputColumnNames: _col0, _col1, _col3, _col4 File Output Operator compressed: false GlobalTableId: 0 @@ -2793,8 +2775,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -2819,13 +2801,13 @@ type: int expr: _col1 type: string - expr: _col2 + expr: '2000-04-08' type: string expr: _col3 type: int expr: _col4 type: string - expr: _col5 + expr: '2000-04-09' type: string Path -> Alias: #### A masked pattern was here #### @@ -2836,8 +2818,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -2845,8 +2827,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3,_col4,_col5 - columns.types int,string,string,int,string,string + columns _col0,_col1,_col3,_col4 + columns.types int,string,int,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -4175,7 +4157,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 2 type: int expr: value type: string @@ -4216,7 +4198,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 3 type: int expr: value type: string @@ -4946,31 +4928,27 @@ type: boolean Select Operator expressions: - expr: key + expr: hr type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col3, _col1 Reduce Output Operator key expressions: - expr: _col0 + expr: 11 + type: int + expr: '2008-04-08' type: string - expr: _col2 - type: string expr: _col3 type: string sort order: +++ tag: -1 value expressions: - expr: _col0 - type: string + expr: 11 + type: int expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -5165,33 +5143,29 @@ type: boolean Select Operator expressions: - expr: key + expr: ds type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col2, _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 11 + type: int expr: _col2 type: string - expr: _col3 + expr: '11' type: string sort order: +++ tag: -1 value expressions: - expr: _col0 - type: string + expr: 11 + type: int expr: _col1 type: string expr: _col2 type: string - expr: _col3 + expr: '11' type: string Path -> Alias: #### A masked pattern was here #### Index: ql/src/test/results/clientpositive/input25.q.out =================================================================== --- ql/src/test/results/clientpositive/input25.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input25.q.out (working copy) @@ -53,7 +53,7 @@ type: int expr: b type: int - expr: d + expr: '2009-01-01' type: string outputColumnNames: _col0, _col1, _col2 Limit @@ -65,7 +65,7 @@ type: int expr: _col1 type: int - expr: _col2 + expr: '2009-01-01' type: string Reduce Operator Tree: Extract @@ -132,7 +132,7 @@ type: int expr: b type: int - expr: d + expr: '2009-02-02' type: string outputColumnNames: _col0, _col1, _col2 Limit @@ -144,7 +144,7 @@ type: int expr: _col1 type: int - expr: _col2 + expr: '2009-02-02' type: string Reduce Operator Tree: Extract Index: ql/src/test/results/clientpositive/udf_between.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_between.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_between.q.out (working copy) @@ -27,7 +27,7 @@ alias: src Filter Operator predicate: - expr: (key + 100) BETWEEN (150 + (- 50)) AND (150 + 50) + expr: (key + 100) BETWEEN 100 AND 200 type: boolean Select Operator expressions: @@ -87,7 +87,7 @@ alias: src Filter Operator predicate: - expr: (key + 100) NOT BETWEEN (150 + (- 50)) AND (150 + 50) + expr: (key + 100) NOT BETWEEN 100 AND 200 type: boolean Select Operator expressions: @@ -145,19 +145,15 @@ Processor Tree: TableScan alias: src - Filter Operator - predicate: - expr: 'b' BETWEEN 'a' AND 'c' - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Limit - ListSink + Select Operator + expressions: + expr: key + type: string + expr: value + type: string + outputColumnNames: _col0, _col1 + Limit + ListSink PREHOOK: query: SELECT * FROM src where 'b' between 'a' AND 'c' LIMIT 1 @@ -186,19 +182,15 @@ Processor Tree: TableScan alias: src - Filter Operator - predicate: - expr: 2 BETWEEN 2 AND '3' - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Limit - ListSink + Select Operator + expressions: + expr: key + type: string + expr: value + type: string + outputColumnNames: _col0, _col1 + Limit + ListSink PREHOOK: query: SELECT * FROM src where 2 between 2 AND '3' LIMIT 1 Index: ql/src/test/results/clientpositive/type_widening.q.out =================================================================== --- ql/src/test/results/clientpositive/type_widening.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/type_widening.q.out (working copy) @@ -19,7 +19,7 @@ alias: src Select Operator expressions: - expr: COALESCE(0,9223372036854775807) + expr: 0 type: bigint outputColumnNames: _col0 Limit Index: ql/src/test/results/clientpositive/subquery_in.q.out =================================================================== --- ql/src/test/results/clientpositive/subquery_in.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/subquery_in.q.out (working copy) @@ -161,24 +161,20 @@ 1 handleSkewJoin: false outputColumnNames: _col0, _col1 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator @@ -305,29 +301,26 @@ 1 handleSkewJoin: false outputColumnNames: _col0, _col1 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator limit: -1 + PREHOOK: query: select * from src b where b.key in @@ -515,24 +508,20 @@ 1 handleSkewJoin: false outputColumnNames: _col1, _col5 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col1 - type: string - expr: _col5 - type: int - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col1 + type: string + expr: _col5 + type: int + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator @@ -743,26 +732,22 @@ 1 handleSkewJoin: false outputColumnNames: _col1, _col2, _col5 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col2 - type: string - expr: _col1 - type: string - expr: _col5 - type: int - outputColumnNames: _col0, _col1, _col2 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col2 + type: string + expr: _col1 + type: string + expr: _col5 + type: int + outputColumnNames: _col0, _col1, _col2 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator @@ -943,24 +928,20 @@ 1 handleSkewJoin: false outputColumnNames: _col0, _col1 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator Index: ql/src/test/results/clientpositive/udf_printf.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_printf.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_printf.q.out (working copy) @@ -41,7 +41,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: printf('Hello World %d %s', 100, 'days') + expr: 'Hello World 100 days' type: string outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/index_auto_update.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_update.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_update.q.out (working copy) @@ -344,8 +344,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 86 + type: int expr: val type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/smb_mapjoin_10.q.out =================================================================== --- ql/src/test/results/clientpositive/smb_mapjoin_10.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/smb_mapjoin_10.q.out (working copy) @@ -79,13 +79,13 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {userid} {pageid} {postid} {type} {ds} - 1 {userid} {pageid} {postid} {type} {ds} + 0 {userid} {pageid} {postid} {type} + 1 {userid} {pageid} {postid} {type} handleSkewJoin: false keys: 0 [Column[userid], Column[pageid], Column[postid], Column[type]] 1 [Column[userid], Column[pageid], Column[postid], Column[type]] - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col7, _col8, _col9, _col10, _col11 + outputColumnNames: _col0, _col1, _col2, _col3, _col7, _col8, _col9, _col10 Position of Big Table: 1 Select Operator expressions: @@ -97,7 +97,7 @@ type: int expr: _col3 type: string - expr: _col4 + expr: '1' type: string expr: _col7 type: int @@ -107,7 +107,7 @@ type: int expr: _col10 type: string - expr: _col11 + expr: '2' type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 File Output Operator Index: ql/src/test/results/clientpositive/constprog2.q.out =================================================================== --- ql/src/test/results/clientpositive/constprog2.q.out (revision 0) +++ ql/src/test/results/clientpositive/constprog2.q.out (revision 0) @@ -0,0 +1,96 @@ +PREHOOK: query: EXPLAIN +SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86 +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86 +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (= (. (TOK_TABLE_OR_COL src1) key) 86)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key)) (TOK_SELEXPR (+ (. (TOK_TABLE_OR_COL src1) key) 1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value))))) + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Alias -> Map Operator Tree: + src1 + TableScan + alias: src1 + Filter Operator + predicate: + expr: (key = 86) + type: boolean + Reduce Output Operator + key expressions: + expr: 86 + type: int + sort order: + + Map-reduce partition columns: + expr: 86 + type: int + tag: 0 + src2 + TableScan + alias: src2 + Filter Operator + predicate: + expr: (key = 86) + type: boolean + Reduce Output Operator + key expressions: + expr: 86 + type: int + sort order: + + Map-reduce partition columns: + expr: 86 + type: int + tag: 1 + value expressions: + expr: value + type: string + Reduce Operator Tree: + Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 + 1 {VALUE._col1} + handleSkewJoin: false + outputColumnNames: _col5 + Select Operator + expressions: + expr: 86 + type: int + expr: 87 + type: int + expr: _col5 + type: string + outputColumnNames: _col0, _col1, _col2 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + + +PREHOOK: query: SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86 +PREHOOK: type: QUERY +PREHOOK: Input: default@src +#### A masked pattern was here #### +POSTHOOK: query: SELECT src1.key, src1.key + 1, src2.value + FROM src src1 join src src2 ON src1.key = src2.key AND src1.key = 86 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +#### A masked pattern was here #### +86 87.0 val_86 Index: ql/src/test/results/clientpositive/join8.q.out =================================================================== --- ql/src/test/results/clientpositive/join8.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/join8.q.out (working copy) @@ -120,7 +120,7 @@ type: int expr: _col1 type: string - expr: UDFToInteger(_col2) + expr: UDFToInteger(null) type: int expr: _col3 type: string Index: ql/src/test/results/clientpositive/set_processor_namespaces.q.out =================================================================== --- ql/src/test/results/clientpositive/set_processor_namespaces.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/set_processor_namespaces.q.out (working copy) @@ -27,8 +27,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 5 + type: int expr: value type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/select_unquote_or.q.out =================================================================== --- ql/src/test/results/clientpositive/select_unquote_or.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/select_unquote_or.q.out (working copy) @@ -70,7 +70,7 @@ alias: npe_test Filter Operator predicate: - expr: ((ds > ((2012 - 11) - 31)) or (ds < ((2012 - 12) - 15))) + expr: ((ds > 1970) or (ds < 1985)) type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/ppd_repeated_alias.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_repeated_alias.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_repeated_alias.q.out (working copy) @@ -92,7 +92,7 @@ type: int expr: _col5 type: int - expr: _col6 + expr: 3 type: int outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -186,7 +186,7 @@ type: int expr: _col5 type: int - expr: _col6 + expr: 3 type: int outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -248,8 +248,6 @@ value expressions: expr: foo type: int - expr: bar - type: int a:b TableScan alias: b @@ -270,17 +268,17 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col0} 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col5 + outputColumnNames: _col0, _col5 Select Operator expressions: expr: _col0 type: int expr: _col5 type: int - expr: _col1 + expr: 3 type: int outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/subquery_notin.q.out =================================================================== --- ql/src/test/results/clientpositive/subquery_notin.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/subquery_notin.q.out (working copy) @@ -165,7 +165,7 @@ outputColumnNames: _col0, _col1, _col4 Filter Operator predicate: - expr: ((1 = 1) and _col4 is null) + expr: _col4 is null type: boolean Select Operator expressions: @@ -450,7 +450,7 @@ outputColumnNames: _col1, _col2, _col5, _col11 Filter Operator predicate: - expr: ((1 = 1) and _col11 is null) + expr: _col11 is null type: boolean Select Operator expressions: @@ -666,7 +666,7 @@ outputColumnNames: _col1, _col5, _col11 Filter Operator predicate: - expr: ((1 = 1) and _col11 is null) + expr: _col11 is null type: boolean Select Operator expressions: @@ -912,7 +912,7 @@ outputColumnNames: _col1, _col2, _col5, _col11 Filter Operator predicate: - expr: ((1 = 1) and _col11 is null) + expr: _col11 is null type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out =================================================================== --- ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out (working copy) @@ -450,7 +450,7 @@ alias: orc_pred Filter Operator predicate: - expr: ((t is not null and (t < 0)) and (t > (- 2))) + expr: ((t is not null and (t < 0)) and (t > -2)) type: boolean Select Operator expressions: @@ -530,11 +530,11 @@ TableScan alias: orc_pred filterExpr: - expr: ((t is not null and (t < 0)) and (t > (- 2))) + expr: ((t is not null and (t < 0)) and (t > -2)) type: boolean Filter Operator predicate: - expr: ((t is not null and (t < 0)) and (t > (- 2))) + expr: ((t is not null and (t < 0)) and (t > -2)) type: boolean Select Operator expressions: @@ -675,15 +675,13 @@ alias: orc_pred Filter Operator predicate: - expr: (((t = (- 1)) and s is not null) and (s like 'bob%')) + expr: (((t = -1) and s is not null) and (s like 'bob%')) type: boolean Select Operator expressions: - expr: t - type: tinyint expr: s type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: expr: _col1 @@ -691,8 +689,8 @@ sort order: + tag: -1 value expressions: - expr: _col0 - type: tinyint + expr: -1 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -748,19 +746,17 @@ TableScan alias: orc_pred filterExpr: - expr: (((t = (- 1)) and s is not null) and (s like 'bob%')) + expr: (((t = -1) and s is not null) and (s like 'bob%')) type: boolean Filter Operator predicate: - expr: (((t = (- 1)) and s is not null) and (s like 'bob%')) + expr: (((t = -1) and s is not null) and (s like 'bob%')) type: boolean Select Operator expressions: - expr: t - type: tinyint expr: s type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: expr: _col1 @@ -768,8 +764,8 @@ sort order: + tag: -1 value expressions: - expr: _col0 - type: tinyint + expr: -1 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -892,7 +888,7 @@ alias: orc_pred Filter Operator predicate: - expr: (((s is not null and (s like 'bob%')) and (not (t) IN ((- 1), (- 2), (- 3)))) and t BETWEEN 25 AND 30) + expr: (((s is not null and (s like 'bob%')) and (not (t) IN (-1, -2, -3))) and t BETWEEN 25 AND 30) type: boolean Select Operator expressions: @@ -969,11 +965,11 @@ TableScan alias: orc_pred filterExpr: - expr: (((s is not null and (s like 'bob%')) and (not (t) IN ((- 1), (- 2), (- 3)))) and t BETWEEN 25 AND 30) + expr: (((s is not null and (s like 'bob%')) and (not (t) IN (-1, -2, -3))) and t BETWEEN 25 AND 30) type: boolean Filter Operator predicate: - expr: (((s is not null and (s like 'bob%')) and (not (t) IN ((- 1), (- 2), (- 3)))) and t BETWEEN 25 AND 30) + expr: (((s is not null and (s like 'bob%')) and (not (t) IN (-1, -2, -3))) and t BETWEEN 25 AND 30) type: boolean Select Operator expressions: @@ -1139,7 +1135,7 @@ alias: orc_pred Filter Operator predicate: - expr: (((((((d >= round(9.99)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((d >= 10.0) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Select Operator expressions: @@ -1231,11 +1227,11 @@ TableScan alias: orc_pred filterExpr: - expr: (((((((d >= round(9.99)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((d >= 10.0) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Filter Operator predicate: - expr: (((((((d >= round(9.99)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((d >= 10.0) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Select Operator expressions: @@ -1417,7 +1413,7 @@ alias: orc_pred Filter Operator predicate: - expr: (((((((((t > 10) and (t <> 101)) and (d >= round(9.99))) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((((t > 10) and (t <> 101)) and (d >= 10.0)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Select Operator expressions: @@ -1545,11 +1541,11 @@ TableScan alias: orc_pred filterExpr: - expr: (((((((((t > 10) and (t <> 101)) and (d >= round(9.99))) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((((t > 10) and (t <> 101)) and (d >= 10.0)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Filter Operator predicate: - expr: (((((((((t > 10) and (t <> 101)) and (d >= round(9.99))) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) + expr: (((((((((t > 10) and (t <> 101)) and (d >= 10.0)) and (d < 12.0)) and t is not null) and (s like '%son')) and (not (s like '%car%'))) and (t > 0)) and si BETWEEN 300 AND 400) type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/udf_instr.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_instr.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_instr.q.out (working copy) @@ -59,27 +59,27 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: instr('abcd''abc') + expr: 1 type: int - expr: instr('abcabc''ccc') + expr: 0 type: int - expr: instr(123'23') + expr: 2 type: int - expr: instr(12323) + expr: 2 type: int - expr: instr(true1) + expr: 0 type: int - expr: instr(false1) + expr: 0 type: int - expr: instr('12345'UDFToByte('2')) + expr: 2 type: int - expr: instr(UDFToShort('12345')'34') + expr: 3 type: int - expr: instr(UDFToLong('123456789012')'456') + expr: 4 type: int - expr: instr(UDFToFloat(1.25)'.25') + expr: 2 type: int - expr: instr(16.0'.0') + expr: 3 type: int expr: instr(null'abc') type: int Index: ql/src/test/results/clientpositive/udf_sign.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_sign.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_sign.q.out (working copy) @@ -20,7 +20,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: sign(0) + expr: 0.0 type: double outputColumnNames: _col0 ListSink @@ -88,7 +88,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: sign(0) + expr: 0.0 type: double outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/udf_minute.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_minute.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_minute.q.out (working copy) @@ -42,12 +42,12 @@ type: boolean Select Operator expressions: - expr: minute('2009-08-07 13:14:15') + expr: 14 type: int - expr: minute('13:14:15') + expr: 14 type: int - expr: minute('2009-08-07') - type: int + expr: null + type: void outputColumnNames: _col0, _col1, _col2 File Output Operator compressed: false Index: ql/src/test/results/clientpositive/udf_reflect2.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_reflect2.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_reflect2.q.out (working copy) @@ -99,7 +99,7 @@ type: int expr: value type: string - expr: CAST( '2013-02-15 19:41:20' AS TIMESTAMP) + expr: 2013-02-15 19:41:20.0 type: timestamp outputColumnNames: _col0, _col1, _col2 Select Operator Index: ql/src/test/results/clientpositive/explain_logical.q.out =================================================================== --- ql/src/test/results/clientpositive/explain_logical.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/explain_logical.q.out (working copy) @@ -541,7 +541,7 @@ type: string expr: value type: string - expr: ds + expr: '10' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/udf_degrees.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_degrees.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_degrees.q.out (working copy) @@ -20,7 +20,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: degrees(pi()) + expr: 180.0 type: double outputColumnNames: _col0 ListSink @@ -71,7 +71,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: degrees(pi()) + expr: 180.0 type: double outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/ppd_udf_col.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_udf_col.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_udf_col.q.out (working copy) @@ -28,19 +28,17 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - outputColumnNames: _col0, _col2 + outputColumnNames: _col2 Filter Operator predicate: expr: (_col2 <= 0.1) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double outputColumnNames: _col0, _col1 @@ -91,30 +89,26 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - outputColumnNames: _col0, _col2 + outputColumnNames: _col2 Filter Operator predicate: expr: (_col2 <= 0.1) type: boolean Select Operator expressions: - expr: _col0 - type: string expr: _col2 type: double - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Filter Operator predicate: expr: (_col1 > 0.1) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col1 type: double outputColumnNames: _col0, _col1 @@ -162,21 +156,19 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - expr: hex(4) + expr: '4' type: string - outputColumnNames: _col0, _col2, _col3 + outputColumnNames: _col2, _col3 Filter Operator predicate: expr: (_col3 <= 3) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double expr: _col3 @@ -225,21 +217,19 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double expr: (value * 10) type: double - outputColumnNames: _col0, _col2, _col3 + outputColumnNames: _col2, _col3 Filter Operator predicate: expr: (_col3 <= 200.0) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double expr: _col3 @@ -288,19 +278,17 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - outputColumnNames: _col0, _col2 + outputColumnNames: _col2 Filter Operator predicate: expr: (_col2 <= 0.1) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double outputColumnNames: _col0, _col1 @@ -351,19 +339,17 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - outputColumnNames: _col0, _col2 + outputColumnNames: _col2 Filter Operator predicate: expr: ((_col2 <= 0.1) and (_col2 > 0.1)) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double outputColumnNames: _col0, _col1 @@ -411,21 +397,19 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double - expr: hex(4) + expr: '4' type: string - outputColumnNames: _col0, _col2, _col3 + outputColumnNames: _col2, _col3 Filter Operator predicate: expr: (_col3 <= 3) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double expr: _col3 @@ -474,21 +458,19 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: rand() type: double expr: (value * 10) type: double - outputColumnNames: _col0, _col2, _col3 + outputColumnNames: _col2, _col3 Filter Operator predicate: expr: (_col3 <= 200.0) type: boolean Select Operator expressions: - expr: _col0 - type: string + expr: 100 + type: int expr: _col2 type: double expr: _col3 Index: ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out =================================================================== --- ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out (working copy) @@ -721,8 +721,6 @@ sort order: tag: 1 value expressions: - expr: p_partkey - type: int expr: p_name type: string expr: p_mfgr @@ -745,9 +743,9 @@ Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} + 1 {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 File Output Operator compressed: false GlobalTableId: 0 @@ -771,8 +769,6 @@ type: string tag: 0 value expressions: - expr: _col11 - type: int expr: _col12 type: string expr: _col13 @@ -843,10 +839,10 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} {VALUE._col11} {VALUE._col12} {VALUE._col13} {VALUE._col14} {VALUE._col15} {VALUE._col16} {VALUE._col17} {VALUE._col18} {VALUE._col19} + 0 {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} {VALUE._col11} {VALUE._col12} {VALUE._col13} {VALUE._col14} {VALUE._col15} {VALUE._col16} {VALUE._col17} {VALUE._col18} {VALUE._col19} 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col4} {VALUE._col5} {VALUE._col6} {VALUE._col7} {VALUE._col8} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30 Select Operator expressions: expr: _col11 @@ -867,7 +863,7 @@ type: double expr: _col19 type: string - expr: _col0 + expr: 1 type: int expr: _col1 type: string Index: ql/src/test/results/clientpositive/input_part6.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part6.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part6.q.out (working copy) @@ -20,7 +20,7 @@ alias: x Filter Operator predicate: - expr: (ds = ((2008 - 4) - 8)) + expr: (ds = 1996) type: boolean Select Operator expressions: @@ -28,7 +28,7 @@ type: string expr: value type: string - expr: ds + expr: '1996' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/ppd_clusterby.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_clusterby.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_clusterby.q.out (working copy) @@ -24,23 +24,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 10 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 10 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 10 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -140,13 +138,11 @@ type: boolean Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -170,8 +166,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 @@ -226,23 +222,21 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 10 + type: int sort order: + Map-reduce partition columns: - expr: _col0 - type: string + expr: 10 + type: int tag: -1 value expressions: - expr: _col0 - type: string + expr: 10 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -304,8 +298,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -332,19 +324,17 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4 + outputColumnNames: _col1, _col4 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -368,8 +358,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 Index: ql/src/test/results/clientpositive/index_auto_partitioned.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_partitioned.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_partitioned.q.out (working copy) @@ -110,20 +110,18 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 86 + type: int sort order: + tag: -1 value expressions: - expr: _col0 - type: string + expr: 86 + type: int expr: _col1 type: string Reduce Operator Tree: Index: ql/src/test/results/clientpositive/input_part1.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part1.q.out (working copy) @@ -43,9 +43,9 @@ type: int expr: value type: string - expr: hr + expr: '12' type: string - expr: ds + expr: '2008-04-08' type: string outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator Index: ql/src/test/results/clientpositive/index_auto_file_format.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_file_format.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_file_format.q.out (working copy) @@ -96,20 +96,18 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 86 + type: int sort order: + tag: -1 value expressions: - expr: _col0 - type: string + expr: 86 + type: int expr: _col1 type: string Reduce Operator Tree: @@ -253,20 +251,18 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 86 + type: int sort order: + tag: -1 value expressions: - expr: _col0 - type: string + expr: 86 + type: int expr: _col1 type: string Reduce Operator Tree: Index: ql/src/test/results/clientpositive/udf9.q.out =================================================================== --- ql/src/test/results/clientpositive/udf9.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf9.q.out (working copy) @@ -40,37 +40,37 @@ type: boolean Select Operator expressions: - expr: datediff('2008-12-31', '2009-01-01') + expr: -1 type: int - expr: datediff('2008-03-01', '2008-02-28') + expr: 2 type: int - expr: datediff('2007-03-01', '2007-01-28') + expr: 32 type: int - expr: datediff('2008-03-01 23:59:59', '2008-03-02 00:00:00') + expr: -1 type: int - expr: date_add('2008-12-31', 1) + expr: '2009-01-01' type: string - expr: date_add('2008-12-31', 365) + expr: '2009-12-31' type: string - expr: date_add('2008-02-28', 2) + expr: '2008-03-01' type: string - expr: date_add('2009-02-28', 2) + expr: '2009-03-02' type: string - expr: date_add('2007-02-28', 365) + expr: '2008-02-28' type: string - expr: date_add('2007-02-28 23:59:59', 730) + expr: '2009-02-27' type: string - expr: date_sub('2009-01-01', 1) + expr: '2008-12-31' type: string - expr: date_sub('2009-01-01', 365) + expr: '2008-01-02' type: string - expr: date_sub('2008-02-28', 2) + expr: '2008-02-26' type: string - expr: date_sub('2009-02-28', 2) + expr: '2009-02-26' type: string - expr: date_sub('2007-02-28', 365) + expr: '2006-02-28' type: string - expr: date_sub('2007-02-28 01:12:34', 730) + expr: '2005-02-28' type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15 File Output Operator Index: ql/src/test/results/clientpositive/input18.q.out =================================================================== --- ql/src/test/results/clientpositive/input18.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input18.q.out (working copy) @@ -42,9 +42,9 @@ type: string expr: value type: string - expr: (1 + 2) + expr: 3 type: int - expr: (3 + 4) + expr: 7 type: int outputColumnNames: _col0, _col1, _col2, _col3 Transform Operator Index: ql/src/test/results/clientpositive/union_view.q.out =================================================================== --- ql/src/test/results/clientpositive/union_view.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/union_view.q.out (working copy) @@ -87,11 +87,11 @@ type: boolean Select Operator expressions: - expr: key + expr: 86 type: int expr: value type: string - expr: ds + expr: '1' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -166,11 +166,11 @@ type: boolean Select Operator expressions: - expr: key + expr: 86 type: int expr: value type: string - expr: ds + expr: '2' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -245,11 +245,11 @@ type: boolean Select Operator expressions: - expr: key + expr: 86 type: int expr: value type: string - expr: ds + expr: '3' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -603,11 +603,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '1' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -639,11 +639,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '1' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -675,11 +675,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '1' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -764,11 +764,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '2' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -800,11 +800,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '2' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -836,11 +836,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '2' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -925,11 +925,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '3' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -961,11 +961,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '3' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -997,11 +997,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '3' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -1090,13 +1090,11 @@ Union Select Operator expressions: - expr: _col0 - type: int - expr: _col1 - type: string expr: _col2 type: string - outputColumnNames: _col0, _col1, _col2 + expr: _col1 + type: string + outputColumnNames: _col2, _col1 Reduce Output Operator key expressions: expr: _col2 @@ -1104,7 +1102,7 @@ sort order: + tag: -1 value expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string @@ -1132,13 +1130,11 @@ Union Select Operator expressions: - expr: _col0 - type: int - expr: _col1 - type: string expr: _col2 type: string - outputColumnNames: _col0, _col1, _col2 + expr: _col1 + type: string + outputColumnNames: _col2, _col1 Reduce Output Operator key expressions: expr: _col2 @@ -1146,7 +1142,7 @@ sort order: + tag: -1 value expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string @@ -1174,13 +1170,11 @@ Union Select Operator expressions: - expr: _col0 - type: int - expr: _col1 - type: string expr: _col2 type: string - outputColumnNames: _col0, _col1, _col2 + expr: _col1 + type: string + outputColumnNames: _col2, _col1 Reduce Output Operator key expressions: expr: _col2 @@ -1188,7 +1182,7 @@ sort order: + tag: -1 value expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string @@ -1848,11 +1842,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '4' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -1884,11 +1878,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '4' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -1920,11 +1914,11 @@ Union Select Operator expressions: - expr: _col0 + expr: 86 type: int expr: _col1 type: string - expr: _col2 + expr: '4' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/smb_mapjoin9.q.out =================================================================== --- ql/src/test/results/clientpositive/smb_mapjoin9.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/smb_mapjoin9.q.out (working copy) @@ -47,12 +47,12 @@ Inner Join 0 to 1 condition expressions: 0 {key} - 1 {key} {value} {ds} + 1 {key} {value} handleSkewJoin: false keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0, _col5, _col6, _col7 + outputColumnNames: _col0, _col5, _col6 Position of Big Table: 0 Select Operator expressions: @@ -60,7 +60,7 @@ type: int expr: _col6 type: string - expr: _col7 + expr: '2010-10-15' type: string expr: _col0 type: int @@ -144,12 +144,12 @@ Inner Join 0 to 1 condition expressions: 0 {key} - 1 {key} {value} {ds} + 1 {key} {value} handleSkewJoin: false keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0, _col5, _col6, _col7 + outputColumnNames: _col0, _col5, _col6 Position of Big Table: 1 Select Operator expressions: @@ -157,7 +157,7 @@ type: int expr: _col6 type: string - expr: _col7 + expr: '2010-10-15' type: string expr: _col0 type: int @@ -274,12 +274,12 @@ Inner Join 0 to 1 condition expressions: 0 {key} - 1 {key} {value} {ds} + 1 {key} {value} handleSkewJoin: false keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0, _col5, _col6, _col7 + outputColumnNames: _col0, _col5, _col6 Position of Big Table: 0 Select Operator expressions: @@ -287,7 +287,7 @@ type: int expr: _col6 type: string - expr: _col7 + expr: '2010-10-15' type: string expr: _col0 type: int Index: ql/src/test/results/clientpositive/udf_format_number.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_format_number.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_format_number.q.out (working copy) @@ -45,11 +45,11 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: format_number(12332.123456, 4) + expr: '12,332.1235' type: string - expr: format_number(12332.1, 4) + expr: '12,332.1000' type: string - expr: format_number(12332.2, 0) + expr: '12,332' type: string outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/sample1.q.out =================================================================== --- ql/src/test/results/clientpositive/sample1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/sample1.q.out (working copy) @@ -47,9 +47,9 @@ type: int expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr + expr: '11' type: string outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator Index: ql/src/test/results/clientpositive/udf_like.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_like.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_like.q.out (working copy) @@ -42,33 +42,33 @@ type: boolean Select Operator expressions: - expr: ('_%_' like '%\_\%\_%') + expr: true type: boolean - expr: ('__' like '%\_\%\_%') + expr: false type: boolean - expr: ('%%_%_' like '%\_\%\_%') + expr: true type: boolean - expr: ('%_%_%' like '%\%\_\%') + expr: true type: boolean - expr: ('_%_' like '\%\_%') + expr: false type: boolean - expr: ('%__' like '__\%%') + expr: false type: boolean - expr: ('_%' like '\_\%\_\%%') + expr: false type: boolean - expr: ('_%' like '\_\%_%') + expr: false type: boolean - expr: ('%_' like '\%\_') + expr: true type: boolean - expr: ('ab' like '\%\_') + expr: false type: boolean - expr: ('ab' like '_a%') + expr: false type: boolean - expr: ('ab' like 'a') + expr: false type: boolean - expr: ('ab' like '') + expr: false type: boolean - expr: ('' like '') + expr: true type: boolean outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 ListSink Index: ql/src/test/results/clientpositive/join_view.q.out =================================================================== --- ql/src/test/results/clientpositive/join_view.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/join_view.q.out (working copy) @@ -78,24 +78,22 @@ value expressions: expr: foo type: int - expr: ds - type: string Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col1} - 1 {VALUE._col0} {VALUE._col2} + 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col1, _col5, _col7 + outputColumnNames: _col1, _col5 Select Operator expressions: expr: _col1 type: string expr: _col5 type: int - expr: _col7 + expr: '2011-09-01' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/udf4.q.out =================================================================== --- ql/src/test/results/clientpositive/udf4.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf4.q.out (working copy) @@ -79,73 +79,73 @@ alias: dest1 Select Operator expressions: - expr: round(1.0) + expr: 1.0 type: double - expr: round(1.5) + expr: 2.0 type: double - expr: round((- 1.5)) + expr: -2.0 type: double - expr: floor(1.0) + expr: 1 type: bigint - expr: floor(1.5) + expr: 1 type: bigint - expr: floor((- 1.5)) + expr: -2 type: bigint - expr: sqrt(1.0) + expr: 1.0 type: double - expr: sqrt((- 1.0)) + expr: null + type: void + expr: 0.0 type: double - expr: sqrt(0.0) - type: double - expr: ceil(1.0) + expr: 1 type: bigint - expr: ceil(1.5) + expr: 2 type: bigint - expr: ceil((- 1.5)) + expr: -1 type: bigint - expr: ceiling(1.0) + expr: 1 type: bigint expr: rand(3) type: double expr: 3 type: int - expr: (- 3) + expr: -3 type: int - expr: (1 + 2) + expr: 3 type: int - expr: (1 + (- 2)) + expr: -1 type: int - expr: (~ 1) + expr: -2 type: int - expr: (~ UDFToByte(1)) + expr: -2 type: tinyint - expr: (~ UDFToShort(1)) + expr: -2 type: smallint - expr: (~ UDFToLong(1)) + expr: -2 type: bigint - expr: (UDFToByte(1) & UDFToByte(2)) + expr: 0 type: tinyint - expr: (UDFToShort(1) & UDFToShort(2)) + expr: 0 type: smallint - expr: (1 & 2) + expr: 0 type: int - expr: (UDFToLong(1) & UDFToLong(2)) + expr: 0 type: bigint - expr: (UDFToByte(1) | UDFToByte(2)) + expr: 3 type: tinyint - expr: (UDFToShort(1) | UDFToShort(2)) + expr: 3 type: smallint - expr: (1 | 2) + expr: 3 type: int - expr: (UDFToLong(1) | UDFToLong(2)) + expr: 3 type: bigint - expr: (UDFToByte(1) ^ UDFToByte(3)) + expr: 2 type: tinyint - expr: (UDFToShort(1) ^ UDFToShort(3)) + expr: 2 type: smallint - expr: (1 ^ 3) + expr: 2 type: int - expr: (UDFToLong(1) ^ UDFToLong(3)) + expr: 2 type: bigint outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30, _col31, _col32, _col33 File Output Operator Index: ql/src/test/results/clientpositive/udf_hour.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_hour.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_hour.q.out (working copy) @@ -41,12 +41,12 @@ type: boolean Select Operator expressions: - expr: hour('2009-08-07 13:14:15') + expr: 13 type: int - expr: hour('13:14:15') + expr: 13 type: int - expr: hour('2009-08-07') - type: int + expr: null + type: void outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/index_bitmap_auto_partitioned.q.out =================================================================== --- ql/src/test/results/clientpositive/index_bitmap_auto_partitioned.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_bitmap_auto_partitioned.q.out (working copy) @@ -136,20 +136,18 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: value type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Reduce Output Operator key expressions: - expr: _col0 - type: string + expr: 86 + type: int sort order: + tag: -1 value expressions: - expr: _col0 - type: string + expr: 86 + type: int expr: _col1 type: string Reduce Operator Tree: Index: ql/src/test/results/clientpositive/index_auto_empty.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_empty.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_empty.q.out (working copy) @@ -70,8 +70,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 86 + type: int expr: val type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/quote1.q.out =================================================================== --- ql/src/test/results/clientpositive/quote1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/quote1.q.out (working copy) @@ -140,7 +140,7 @@ type: int expr: type type: string - expr: table + expr: '2008-04-08' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/udf_rpad.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_rpad.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_rpad.q.out (working copy) @@ -41,11 +41,11 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: rpad('hi', 1, '?') + expr: 'h' type: string - expr: rpad('hi', 5, '.') + expr: 'hi...' type: string - expr: rpad('hi', 6, '123') + expr: 'hi1231' type: string outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/cast1.q.out =================================================================== --- ql/src/test/results/clientpositive/cast1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/cast1.q.out (working copy) @@ -35,19 +35,19 @@ type: boolean Select Operator expressions: - expr: (3 + 2) + expr: 5 type: int - expr: (3.0 + 2) + expr: 5.0 type: double - expr: (3 + 2.0) + expr: 5.0 type: double - expr: (3.0 + 2.0) + expr: 5.0 type: double - expr: ((3 + UDFToInteger(2.0)) + UDFToInteger(UDFToShort(0))) + expr: 5 type: int - expr: UDFToBoolean(1) + expr: true type: boolean - expr: UDFToInteger(true) + expr: 1 type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 File Output Operator Index: ql/src/test/results/clientpositive/rand_partitionpruner3.q.out =================================================================== --- ql/src/test/results/clientpositive/rand_partitionpruner3.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/rand_partitionpruner3.q.out (working copy) @@ -32,7 +32,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string @@ -157,7 +157,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/udf_nvl.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_nvl.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_nvl.q.out (working copy) @@ -37,7 +37,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: if 1 is null returns2 + expr: 1 type: int expr: if null is null returns5 type: int Index: ql/src/test/results/clientpositive/nonmr_fetch.q.out =================================================================== --- ql/src/test/results/clientpositive/nonmr_fetch.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/nonmr_fetch.q.out (working copy) @@ -69,9 +69,9 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr + expr: '11' type: string outputColumnNames: _col0, _col1, _col2, _col3 Limit @@ -364,9 +364,9 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr + expr: '11' type: string outputColumnNames: _col0, _col1, _col2, _col3 Limit Index: ql/src/test/results/clientpositive/udf_hash.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_hash.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_hash.q.out (working copy) @@ -40,27 +40,27 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: hash(UDFToByte(1)) + expr: 1 type: int - expr: hash(UDFToShort(2)) + expr: 2 type: int - expr: hash(3) + expr: 3 type: int - expr: hash(UDFToLong('123456789012')) + expr: -1097262584 type: int - expr: hash(UDFToFloat(1.25)) + expr: 1067450368 type: int - expr: hash(16.0) + expr: 1076887552 type: int - expr: hash('400') + expr: 51508 type: int - expr: hash('abc') + expr: 96354 type: int - expr: hash(true) + expr: 1 type: int - expr: hash(false) + expr: 0 type: int - expr: hash(1,2,3) + expr: 1026 type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 ListSink Index: ql/src/test/results/clientpositive/regexp_extract.q.out =================================================================== --- ql/src/test/results/clientpositive/regexp_extract.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/regexp_extract.q.out (working copy) @@ -37,9 +37,9 @@ type: string expr: value type: string - expr: (1 + 2) + expr: 3 type: int - expr: (3 + 4) + expr: 7 type: int outputColumnNames: _col0, _col1, _col2, _col3 Transform Operator @@ -300,9 +300,9 @@ type: string expr: value type: string - expr: (1 + 2) + expr: 3 type: int - expr: (3 + 4) + expr: 7 type: int outputColumnNames: _col0, _col1, _col2, _col3 Transform Operator Index: ql/src/test/results/clientpositive/udf_locate.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_locate.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_locate.q.out (working copy) @@ -67,31 +67,31 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: locate('abc''abcd') + expr: 1 type: int - expr: locate('ccc''abcabc') + expr: 0 type: int - expr: locate('23'123) + expr: 2 type: int - expr: locate(23123) + expr: 2 type: int - expr: locate('abc''abcabc'2) + expr: 4 type: int - expr: locate('abc''abcabc''2') + expr: 4 type: int - expr: locate(1true) + expr: 0 type: int - expr: locate(1false) + expr: 0 type: int - expr: locate(UDFToByte('2')'12345') + expr: 2 type: int - expr: locate('34'UDFToShort('12345')) + expr: 3 type: int - expr: locate('456'UDFToLong('123456789012')) + expr: 4 type: int - expr: locate('.25'UDFToFloat(1.25)) + expr: 2 type: int - expr: locate('.0'16.0) + expr: 3 type: int expr: locate(null'abc') type: int @@ -99,7 +99,7 @@ type: int expr: locate('abc''abcd'null) type: int - expr: locate('abc''abcd''invalid number') + expr: 0 type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16 ListSink Index: ql/src/test/results/clientpositive/udf_PI.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_PI.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_PI.q.out (working copy) @@ -20,7 +20,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: pi() + expr: 3.141592653589793 type: double outputColumnNames: _col0 ListSink @@ -71,7 +71,7 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: pi() + expr: 3.141592653589793 type: double outputColumnNames: _col0 ListSink Index: ql/src/test/results/clientpositive/mapjoin1.q.out =================================================================== --- ql/src/test/results/clientpositive/mapjoin1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/mapjoin1.q.out (working copy) @@ -375,19 +375,15 @@ a TableScan alias: a - Filter Operator - predicate: - expr: true - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 1 + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + Position of Big Table: 1 Stage: Stage-1 Map Reduce @@ -395,41 +391,37 @@ b TableScan alias: b - Filter Operator - predicate: - expr: true - type: boolean - Map Join Operator - condition map: - Right Outer Join0 to 1 - condition expressions: - 0 {key} {value} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - Limit - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Map Join Operator + condition map: + Right Outer Join0 to 1 + condition expressions: + 0 {key} {value} + 1 {key} {value} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + outputColumnNames: _col0, _col1, _col4, _col5 + Position of Big Table: 1 + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + expr: _col4 + type: string + expr: _col5 + type: string + outputColumnNames: _col0, _col1, _col2, _col3 + Limit + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Local Work: Map Reduce Local Work Index: ql/src/test/results/clientpositive/lateral_view_ppd.q.out =================================================================== --- ql/src/test/results/clientpositive/lateral_view_ppd.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/lateral_view_ppd.q.out (working copy) @@ -128,7 +128,7 @@ expressions: expr: _col1 type: string - expr: _col4 + expr: 1 type: int outputColumnNames: _col0, _col1 File Output Operator @@ -155,7 +155,7 @@ expressions: expr: _col1 type: string - expr: _col4 + expr: 1 type: int outputColumnNames: _col0, _col1 File Output Operator Index: ql/src/test/results/clientpositive/udf_when.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_when.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_when.q.out (working copy) @@ -80,18 +80,18 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: CASE WHEN ((1 = 1)) THEN (2) WHEN ((1 = 3)) THEN (4) ELSE (5) END + expr: 2 type: int - expr: CASE WHEN ((6 = 7)) THEN (8) ELSE (9) END + expr: 9 type: int - expr: CASE WHEN ((10 = 11)) THEN (12) WHEN ((13 = 13)) THEN (14) END + expr: 14 type: int - expr: CASE WHEN ((15 = 16)) THEN (17) WHEN ((18 = 19)) THEN (20) END + expr: null + type: void + expr: CASE WHEN (false) THEN (null) WHEN (true) THEN (24) END type: int - expr: CASE WHEN ((21 = 22)) THEN (null) WHEN ((23 = 23)) THEN (24) END + expr: CASE WHEN (false) THEN (27) WHEN (true) THEN (null) END type: int - expr: CASE WHEN ((25 = 26)) THEN (27) WHEN ((28 = 28)) THEN (null) END - type: int outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 ListSink Index: ql/src/test/results/clientpositive/ppd_union_view.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_union_view.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_union_view.q.out (working copy) @@ -378,7 +378,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2011-10-13' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -426,7 +426,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2011-10-13' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -674,7 +674,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2011-10-15' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator @@ -717,7 +717,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2011-10-15' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/input_part8.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part8.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part8.q.out (working copy) @@ -23,7 +23,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/multi_insert.q.out =================================================================== --- ql/src/test/results/clientpositive/multi_insert.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/multi_insert.q.out (working copy) @@ -3603,8 +3603,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3621,8 +3621,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3639,8 +3639,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3777,8 +3777,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3795,8 +3795,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3813,8 +3813,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3951,8 +3951,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3969,8 +3969,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -3987,8 +3987,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4125,8 +4125,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4143,8 +4143,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 2 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -4161,8 +4161,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 4 + type: int expr: value type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/insert1.q.out =================================================================== --- ql/src/test/results/clientpositive/insert1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/insert1.q.out (working copy) @@ -46,11 +46,11 @@ alias: a Filter Operator predicate: - expr: (key = (- 1)) + expr: (key = -1) type: boolean Select Operator expressions: - expr: key + expr: -1 type: int expr: value type: string @@ -149,11 +149,11 @@ alias: a Filter Operator predicate: - expr: (key = (- 1)) + expr: (key = -1) type: boolean Select Operator expressions: - expr: key + expr: -1 type: int expr: value type: string @@ -267,11 +267,11 @@ alias: a Filter Operator predicate: - expr: (key = (- 1)) + expr: (key = -1) type: boolean Select Operator expressions: - expr: key + expr: -1 type: int expr: value type: string @@ -370,11 +370,11 @@ alias: a Filter Operator predicate: - expr: (key = (- 1)) + expr: (key = -1) type: boolean Select Operator expressions: - expr: key + expr: -1 type: int expr: value type: string Index: ql/src/test/results/clientpositive/ql_rewrite_gbtoidx.q.out =================================================================== --- ql/src/test/results/clientpositive/ql_rewrite_gbtoidx.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ql_rewrite_gbtoidx.q.out (working copy) @@ -1309,7 +1309,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 1 type: int expr: _count_of_key type: bigint @@ -1317,9 +1317,9 @@ Group By Operator aggregations: expr: sum(_count_of_key) - bucketGroup: true + bucketGroup: false keys: - expr: key + expr: 1 type: int mode: hash outputColumnNames: _col0, _col1 @@ -1768,14 +1768,10 @@ expr: (key = 3) type: boolean Select Operator - expressions: - expr: key - type: int - outputColumnNames: key Group By Operator bucketGroup: false keys: - expr: key + expr: 3 type: int mode: hash outputColumnNames: _col0 @@ -2091,15 +2087,13 @@ expressions: expr: key type: int - expr: value - type: int - outputColumnNames: key, value + outputColumnNames: key Group By Operator bucketGroup: false keys: expr: key type: int - expr: value + expr: 1 type: int mode: hash outputColumnNames: _col0, _col1 @@ -2484,15 +2478,13 @@ expressions: expr: key type: int - expr: value - type: int - outputColumnNames: key, value + outputColumnNames: key Group By Operator bucketGroup: false keys: expr: key type: int - expr: value + expr: 2 type: int mode: hash outputColumnNames: _col0, _col1 @@ -2570,18 +2562,12 @@ expr: ((value = 2) and (key = 3)) type: boolean Select Operator - expressions: - expr: key - type: int - expr: value - type: int - outputColumnNames: key, value Group By Operator bucketGroup: false keys: - expr: key + expr: 3 type: int - expr: value + expr: 2 type: int mode: hash outputColumnNames: _col0, _col1 @@ -2964,7 +2950,7 @@ expressions: expr: _col0 type: int - expr: _col1 + expr: 2 type: int outputColumnNames: _col0, _col1 File Output Operator Index: ql/src/test/results/clientpositive/sample8.q.out =================================================================== --- ql/src/test/results/clientpositive/sample8.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/sample8.q.out (working copy) @@ -263,11 +263,7 @@ type: string expr: _col1 type: string - expr: _col2 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 0 @@ -277,8 +273,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3 - columns.types string,string,string,string + columns _col0,_col1 + columns.types string,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -310,9 +306,9 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string - expr: _col3 + expr: '11' type: string Path -> Alias: #### A masked pattern was here #### @@ -323,8 +319,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3 - columns.types string,string,string,string + columns _col0,_col1 + columns.types string,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe @@ -332,8 +328,8 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat properties: - columns _col0,_col1,_col2,_col3 - columns.types string,string,string,string + columns _col0,_col1 + columns.types string,string escape.delim \ serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe Index: ql/src/test/results/clientpositive/ppd_udf_case.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_udf_case.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_udf_case.q.out (working copy) @@ -105,19 +105,15 @@ type: string expr: _col1 type: string - expr: _col2 - type: string expr: _col3 type: string expr: _col6 type: string expr: _col7 type: string - expr: _col8 - type: string expr: _col9 type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7 File Output Operator compressed: false GlobalTableId: 0 @@ -137,7 +133,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -145,7 +141,7 @@ type: string expr: _col5 type: string - expr: _col6 + expr: '2008-04-08' type: string expr: _col7 type: string @@ -156,7 +152,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -164,7 +160,7 @@ type: string expr: _col5 type: string - expr: _col6 + expr: '2008-04-08' type: string expr: _col7 type: string @@ -278,8 +274,6 @@ type: string expr: value type: string - expr: ds - type: string expr: hr type: string b @@ -303,8 +297,6 @@ type: string expr: value type: string - expr: ds - type: string expr: hr type: string Reduce Operator Tree: @@ -312,29 +304,25 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} {VALUE._col3} + 0 {VALUE._col0} {VALUE._col1} {VALUE._col3} + 1 {VALUE._col0} {VALUE._col1} {VALUE._col3} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3, _col6, _col7, _col8, _col9 + outputColumnNames: _col0, _col1, _col3, _col6, _col7, _col9 Select Operator expressions: expr: _col0 type: string expr: _col1 type: string - expr: _col2 - type: string expr: _col3 type: string expr: _col6 type: string expr: _col7 type: string - expr: _col8 - type: string expr: _col9 type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7 File Output Operator compressed: false GlobalTableId: 0 @@ -354,7 +342,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -362,7 +350,7 @@ type: string expr: _col5 type: string - expr: _col6 + expr: '2008-04-08' type: string expr: _col7 type: string @@ -373,7 +361,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -381,7 +369,7 @@ type: string expr: _col5 type: string - expr: _col6 + expr: '2008-04-08' type: string expr: _col7 type: string Index: ql/src/test/results/clientpositive/input_part3.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part3.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part3.q.out (working copy) @@ -23,10 +23,10 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr - type: string + expr: 11 + type: int outputColumnNames: _col0, _col1, _col2, _col3 ListSink Index: ql/src/test/results/clientpositive/set_variable_sub.q.out =================================================================== --- ql/src/test/results/clientpositive/set_variable_sub.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/set_variable_sub.q.out (working copy) @@ -22,7 +22,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 'value1' type: string expr: value type: string @@ -64,7 +64,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 'value1' type: string expr: value type: string @@ -106,7 +106,7 @@ type: boolean Select Operator expressions: - expr: key + expr: '1' type: string expr: value type: string Index: ql/src/test/results/clientpositive/merge_dynamic_partition.q.out =================================================================== --- ql/src/test/results/clientpositive/merge_dynamic_partition.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/merge_dynamic_partition.q.out (working copy) @@ -1321,10 +1321,10 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr - type: string + expr: 11 + type: int outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: false Index: ql/src/test/results/clientpositive/ppd_outer_join5.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_outer_join5.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_outer_join5.q.out (working copy) @@ -96,8 +96,6 @@ type: int tag: 2 value expressions: - expr: id - type: int expr: key type: string expr: value @@ -110,9 +108,9 @@ condition expressions: 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} - 2 {VALUE._col0} {VALUE._col1} {VALUE._col2} + 2 {VALUE._col1} {VALUE._col2} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7, _col10, _col11, _col12 + outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7, _col11, _col12 Select Operator expressions: expr: _col0 @@ -127,7 +125,7 @@ type: string expr: _col7 type: string - expr: _col10 + expr: 20 type: int expr: _col11 type: string @@ -202,8 +200,6 @@ type: int tag: 1 value expressions: - expr: id - type: int expr: key type: string expr: value @@ -238,10 +234,10 @@ Left Outer Join1 to 2 condition expressions: 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} + 1 {VALUE._col1} {VALUE._col2} 2 {VALUE._col0} {VALUE._col1} {VALUE._col2} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7, _col10, _col11, _col12 + outputColumnNames: _col0, _col1, _col2, _col6, _col7, _col10, _col11, _col12 Select Operator expressions: expr: _col0 @@ -250,7 +246,7 @@ type: string expr: _col2 type: string - expr: _col5 + expr: 20 type: int expr: _col6 type: string @@ -331,8 +327,6 @@ type: int tag: 1 value expressions: - expr: id - type: int expr: key type: string expr: value @@ -367,10 +361,10 @@ Left Outer Join0 to 2 condition expressions: 0 {VALUE._col0} {VALUE._col1} {VALUE._col2} - 1 {VALUE._col0} {VALUE._col1} {VALUE._col2} + 1 {VALUE._col1} {VALUE._col2} 2 {VALUE._col0} {VALUE._col1} {VALUE._col2} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col5, _col6, _col7, _col10, _col11, _col12 + outputColumnNames: _col0, _col1, _col2, _col6, _col7, _col10, _col11, _col12 Select Operator expressions: expr: _col0 @@ -379,7 +373,7 @@ type: string expr: _col2 type: string - expr: _col5 + expr: 20 type: int expr: _col6 type: string Index: ql/src/test/results/clientpositive/udf_lpad.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_lpad.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_lpad.q.out (working copy) @@ -41,11 +41,11 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: lpad('hi', 1, '?') + expr: 'h' type: string - expr: lpad('hi', 5, '.') + expr: '...hi' type: string - expr: lpad('hi', 6, '123') + expr: '1231hi' type: string outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/udf_10_trims.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_10_trims.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_10_trims.q.out (working copy) @@ -41,7 +41,7 @@ type: boolean Select Operator expressions: - expr: trim(trim(trim(trim(trim(trim(trim(trim(trim(trim(' abc ')))))))))) + expr: 'abc' type: string outputColumnNames: _col0 File Output Operator Index: ql/src/test/results/clientpositive/udf6.q.out =================================================================== --- ql/src/test/results/clientpositive/udf6.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf6.q.out (working copy) @@ -35,7 +35,7 @@ alias: dest1 Select Operator expressions: - expr: if(true, 1, 2) + expr: 1 type: int outputColumnNames: _col0 File Output Operator @@ -94,21 +94,21 @@ alias: dest1 Select Operator expressions: - expr: if(true, 1, 2) + expr: 1 type: int - expr: if(false, 1, 2) + expr: 2 type: int expr: if(null, 1, 2) type: int - expr: if(true, 'a', 'b') + expr: 'a' type: string - expr: if(true, 0.1, 0.2) + expr: 0.1 type: double - expr: if(false, UDFToLong(1), UDFToLong(2)) + expr: 2 type: bigint - expr: if(false, UDFToByte(127), UDFToByte(126)) + expr: 126 type: tinyint - expr: if(false, UDFToShort(127), UDFToShort(128)) + expr: 128 type: smallint expr: 128 type: int Index: ql/src/test/results/clientpositive/input38.q.out =================================================================== --- ql/src/test/results/clientpositive/input38.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input38.q.out (working copy) @@ -45,9 +45,9 @@ type: string expr: value type: string - expr: (1 + 2) + expr: 3 type: int - expr: (3 + 4) + expr: 7 type: int outputColumnNames: _col0, _col1, _col2, _col3 Transform Operator Index: ql/src/test/results/clientpositive/groupby_ppd.q.out =================================================================== --- ql/src/test/results/clientpositive/groupby_ppd.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/groupby_ppd.q.out (working copy) @@ -120,7 +120,7 @@ outputColumnNames: _col0, _col1 Select Operator expressions: - expr: _col0 + expr: 1 type: int expr: _col1 type: int Index: ql/src/test/results/clientpositive/udf1.q.out =================================================================== --- ql/src/test/results/clientpositive/udf1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf1.q.out (working copy) @@ -55,45 +55,45 @@ type: boolean Select Operator expressions: - expr: ('a' like '%a%') + expr: true type: boolean - expr: ('b' like '%a%') + expr: false type: boolean - expr: ('ab' like '%a%') + expr: true type: boolean - expr: ('ab' like '%a_') + expr: true type: boolean - expr: ('%_' like '\%\_') + expr: true type: boolean - expr: ('ab' like '\%\_') + expr: false type: boolean - expr: ('ab' like '_a%') + expr: false type: boolean - expr: ('ab' like 'a') + expr: false type: boolean - expr: ('' rlike '.*') + expr: true type: boolean - expr: ('a' rlike '[ab]') + expr: true type: boolean - expr: ('' rlike '[ab]') + expr: false type: boolean - expr: ('hadoop' rlike '[a-z]*') + expr: true type: boolean - expr: ('hadoop' rlike 'o*') + expr: true type: boolean - expr: regexp_replace('abc', 'b', 'c') + expr: 'acc' type: string - expr: regexp_replace('abc', 'z', 'a') + expr: 'abc' type: string - expr: regexp_replace('abbbb', 'bb', 'b') + expr: 'abb' type: string - expr: regexp_replace('hadoop', '(.)[a-z]*', '$1ive') + expr: 'hive' type: string - expr: regexp_replace('hadoopAAA', 'A.*', '') + expr: 'hadoop' type: string - expr: regexp_replace('abc', '', 'A') + expr: 'AaAbAcA' type: string - expr: ('abc' rlike '') + expr: false type: boolean outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 File Output Operator Index: ql/src/test/results/clientpositive/udf_repeat.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_repeat.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_repeat.q.out (working copy) @@ -41,13 +41,13 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: repeat('Facebook', 3) + expr: 'FacebookFacebookFacebook' type: string - expr: repeat('', 4) + expr: '' type: string - expr: repeat('asd', 0) + expr: '' type: string - expr: repeat('asdf', (- 1)) + expr: '' type: string outputColumnNames: _col0, _col1, _col2, _col3 ListSink Index: ql/src/test/results/clientpositive/join_nullsafe.q.out =================================================================== --- ql/src/test/results/clientpositive/join_nullsafe.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/join_nullsafe.q.out (working copy) @@ -1637,16 +1637,14 @@ type: boolean Reduce Output Operator key expressions: - expr: key - type: int + expr: null + type: void sort order: + Map-reduce partition columns: - expr: key - type: int + expr: null + type: void tag: 0 value expressions: - expr: key - type: int expr: value type: int b @@ -1658,38 +1656,36 @@ type: boolean Reduce Output Operator key expressions: - expr: value - type: int + expr: null + type: void sort order: + Map-reduce partition columns: - expr: value - type: int + expr: null + type: void tag: 1 value expressions: expr: key type: int - expr: value - type: int Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} + 1 {VALUE._col0} handleSkewJoin: false nullSafes: [true] - outputColumnNames: _col0, _col1, _col4, _col5 + outputColumnNames: _col1, _col4 Select Operator expressions: - expr: _col0 - type: int + expr: null + type: void expr: _col1 type: int expr: _col4 type: int - expr: _col5 - type: int + expr: null + type: void outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: false Index: ql/src/test/results/clientpositive/macro.q.out =================================================================== --- ql/src/test/results/clientpositive/macro.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/macro.q.out (working copy) @@ -30,7 +30,7 @@ alias: src Select Operator expressions: - expr: SIGMOID(2) + expr: 0.8807970779778823 type: double outputColumnNames: _col0 Limit @@ -57,7 +57,7 @@ GatherStats: false Select Operator expressions: - expr: SIGMOID(2) + expr: 0.8807970779778823 type: double outputColumnNames: _col0 Limit @@ -100,7 +100,7 @@ alias: src Select Operator expressions: - expr: (FIXED_NUMBER() + 1) + expr: 2 type: int outputColumnNames: _col0 Limit @@ -127,7 +127,7 @@ GatherStats: false Select Operator expressions: - expr: (FIXED_NUMBER() + 1) + expr: 2 type: int outputColumnNames: _col0 Limit @@ -191,7 +191,7 @@ alias: src Select Operator expressions: - expr: SIMPLE_ADD(1, 9) + expr: 10 type: int outputColumnNames: _col0 Limit @@ -218,7 +218,7 @@ GatherStats: false Select Operator expressions: - expr: SIMPLE_ADD(1, 9) + expr: 10 type: int outputColumnNames: _col0 Limit Index: ql/src/test/results/clientpositive/input42.q.out =================================================================== --- ql/src/test/results/clientpositive/input42.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input42.q.out (working copy) @@ -23,13 +23,11 @@ expressions: expr: key type: string - expr: value - type: string - expr: ds - type: string expr: hr type: string - outputColumnNames: _col0, _col1, _col2, _col3 + expr: value + type: string + outputColumnNames: _col0, _col3, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -43,7 +41,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -1208,13 +1206,11 @@ expressions: expr: key type: string - expr: value - type: string - expr: ds - type: string expr: hr type: string - outputColumnNames: _col0, _col1, _col2, _col3 + expr: value + type: string + outputColumnNames: _col0, _col3, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -1228,7 +1224,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string @@ -1771,13 +1767,11 @@ expressions: expr: key type: string - expr: value - type: string - expr: ds - type: string expr: hr type: string - outputColumnNames: _col0, _col1, _col2, _col3 + expr: value + type: string + outputColumnNames: _col0, _col3, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -1791,7 +1785,7 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string expr: _col3 type: string Index: ql/src/test/results/clientpositive/constprog1.q.out =================================================================== --- ql/src/test/results/clientpositive/constprog1.q.out (revision 0) +++ ql/src/test/results/clientpositive/constprog1.q.out (revision 0) @@ -0,0 +1,41 @@ +PREHOOK: query: EXPLAIN +SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows) +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows) +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) (TOK_TABLESPLITSAMPLE TOK_ROWCOUNT 1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION IF (> (TOK_FUNCTION INSTR (TOK_FUNCTION CONCAT 'foo' 'bar') 'foob') 0) "F1" "B1"))))) + +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: src + Row Limit Per Split: 1 + Select Operator + expressions: + expr: 'F1' + type: string + outputColumnNames: _col0 + ListSink + + +PREHOOK: query: SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows) +PREHOOK: type: QUERY +PREHOOK: Input: default@src +#### A masked pattern was here #### +POSTHOOK: query: SELECT IF(INSTR(CONCAT('foo', 'bar'), 'foob') > 0, "F1", "B1") + FROM src tablesample (1 rows) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +#### A masked pattern was here #### +F1 Index: ql/src/test/results/clientpositive/subquery_multiinsert.q.out =================================================================== --- ql/src/test/results/clientpositive/subquery_multiinsert.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/subquery_multiinsert.q.out (working copy) @@ -137,25 +137,21 @@ 1 handleSkewJoin: false outputColumnNames: _col0, _col1 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.src_4 + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 1 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.src_4 Stage: Stage-0 Move Operator @@ -224,7 +220,7 @@ outputColumnNames: _col0, _col1, _col4 Filter Operator predicate: - expr: ((1 = 1) and _col4 is null) + expr: _col4 is null type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/regex_col.q.out =================================================================== --- ql/src/test/results/clientpositive/regex_col.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/regex_col.q.out (working copy) @@ -236,7 +236,7 @@ type: boolean Reduce Output Operator key expressions: - expr: key + expr: '103' type: string expr: hr type: string @@ -244,7 +244,7 @@ type: string sort order: +++ Map-reduce partition columns: - expr: key + expr: '103' type: string expr: hr type: string @@ -260,7 +260,7 @@ type: boolean Reduce Output Operator key expressions: - expr: key + expr: '103' type: string expr: hr type: string @@ -268,7 +268,7 @@ type: string sort order: +++ Map-reduce partition columns: - expr: key + expr: '103' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/vectorization_short_regress.q.out =================================================================== --- ql/src/test/results/clientpositive/vectorization_short_regress.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/vectorization_short_regress.q.out (working copy) @@ -147,7 +147,7 @@ alias: alltypesorc Filter Operator predicate: - expr: ((((762 = cbigint) or ((csmallint < cfloat) and ((ctimestamp2 > (- 10669)) and (cdouble <> cint)))) or (cstring1 = 'a')) or ((cbigint <= (- 1.389)) and ((cstring2 <> 'a') and ((79.553 <> cint) and (cboolean2 <> cboolean1))))) + expr: ((((762 = cbigint) or ((csmallint < cfloat) and ((ctimestamp2 > -10669) and (cdouble <> cint)))) or (cstring1 = 'a')) or ((cbigint <= -1.389) and ((cstring2 <> 'a') and ((79.553 <> cint) and (cboolean2 <> cboolean1))))) type: boolean Vectorized execution: true Select Operator @@ -220,13 +220,13 @@ expressions: expr: _col0 type: double - expr: (_col0 + (- 3728)) + expr: (_col0 + -3728) type: double - expr: (- (_col0 + (- 3728))) + expr: (- (_col0 + -3728)) type: double - expr: (- (- (_col0 + (- 3728)))) + expr: (- (- (_col0 + -3728))) type: double - expr: ((- (- (_col0 + (- 3728)))) * (_col0 + (- 3728))) + expr: ((- (- (_col0 + -3728))) * (_col0 + -3728)) type: double expr: _col1 type: double @@ -234,15 +234,15 @@ type: double expr: _col2 type: double - expr: (((- (- (_col0 + (- 3728)))) * (_col0 + (- 3728))) * (- (- (_col0 + (- 3728))))) + expr: (((- (- (_col0 + -3728))) * (_col0 + -3728)) * (- (- (_col0 + -3728)))) type: double expr: _col3 type: double expr: (- _col2) type: double - expr: (_col2 - (- (- (_col0 + (- 3728))))) + expr: (_col2 - (- (- (_col0 + -3728)))) type: double - expr: ((_col2 - (- (- (_col0 + (- 3728))))) * _col2) + expr: ((_col2 - (- (- (_col0 + -3728)))) * _col2) type: double expr: _col4 type: double @@ -252,11 +252,11 @@ type: double expr: (- (10.175 - _col4)) type: double - expr: ((- _col2) / (- 563)) + expr: ((- _col2) / -563) type: double expr: _col6 type: double - expr: (- ((- _col2) / (- 563))) + expr: (- ((- _col2) / -563)) type: double expr: (_col0 / _col1) type: double @@ -264,7 +264,7 @@ type: tinyint expr: _col8 type: bigint - expr: (_col7 / ((- _col2) / (- 563))) + expr: (_col7 / ((- _col2) / -563)) type: double expr: (- (_col0 / _col1)) type: double @@ -452,7 +452,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (((((cbigint <= 197) and (cint < cbigint)) or ((cdouble >= (- 26.28)) and (csmallint > cdouble))) or ((ctinyint > cfloat) and (cstring1 rlike '.*ss.*'))) or ((cfloat > 79.553) and (cstring2 like '10%'))) + expr: (((((cbigint <= 197) and (cint < cbigint)) or ((cdouble >= -26.28) and (csmallint > cdouble))) or ((ctinyint > cfloat) and (cstring1 rlike '.*ss.*'))) or ((cfloat > 79.553) and (cstring2 like '10%'))) type: boolean Vectorized execution: true Select Operator @@ -525,17 +525,17 @@ expressions: expr: _col0 type: int - expr: (_col0 / (- 3728)) + expr: (_col0 / -3728) type: double - expr: (_col0 * (- 3728)) + expr: (_col0 * -3728) type: int expr: _col1 type: double - expr: (- (_col0 * (- 3728))) + expr: (- (_col0 * -3728)) type: int expr: _col2 type: double - expr: ((- 563) % (_col0 * (- 3728))) + expr: (-563 % (_col0 * -3728)) type: int expr: (_col1 / _col2) type: double @@ -549,23 +549,23 @@ type: double expr: _col5 type: int - expr: ((_col0 * (- 3728)) % (_col2 - 10.175)) + expr: ((_col0 * -3728) % (_col2 - 10.175)) type: double expr: (- _col3) type: double expr: _col6 type: double - expr: (_col3 % (- 26.28)) + expr: (_col3 % -26.28) type: double expr: _col7 type: double - expr: (- (_col0 / (- 3728))) + expr: (- (_col0 / -3728)) type: double - expr: ((- (_col0 * (- 3728))) % ((- 563) % (_col0 * (- 3728)))) + expr: ((- (_col0 * -3728)) % (-563 % (_col0 * -3728))) type: int - expr: ((_col0 / (- 3728)) - _col4) + expr: ((_col0 / -3728) - _col4) type: double - expr: (- (_col0 * (- 3728))) + expr: (- (_col0 * -3728)) type: int expr: _col8 type: double @@ -827,7 +827,7 @@ type: double expr: (- (- _col0)) type: double - expr: ((- 1) % (- _col0)) + expr: (-1 % (- _col0)) type: double expr: _col1 type: bigint @@ -853,7 +853,7 @@ type: bigint expr: _col7 type: double - expr: ((- 3728) % (_col2 + (762 * (- _col1)))) + expr: (-3728 % (_col2 + (762 * (- _col1)))) type: bigint outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21 File Output Operator @@ -1092,7 +1092,7 @@ type: double expr: _col5 type: float - expr: (_col4 * (- 26.28)) + expr: (_col4 * -26.28) type: double outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 File Output Operator @@ -1252,7 +1252,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (((((cstring1 rlike 'a.*') and (cstring2 like '%ss%')) or ((1 <> cboolean2) and ((csmallint < 79.553) and ((- 257) <> ctinyint)))) or ((cdouble > ctinyint) and (cfloat >= cint))) or ((cint < cbigint) and (ctinyint > cbigint))) + expr: (((((cstring1 rlike 'a.*') and (cstring2 like '%ss%')) or ((1 <> cboolean2) and ((csmallint < 79.553) and (-257 <> ctinyint)))) or ((cdouble > ctinyint) and (cfloat >= cint))) or ((cint < cbigint) and (ctinyint > cbigint))) type: boolean Vectorized execution: true Select Operator @@ -1277,11 +1277,11 @@ type: smallint expr: cbigint type: bigint - expr: ((- 3728) * cbigint) + expr: (-3728 * cbigint) type: bigint expr: (- cint) type: int - expr: ((- 863.257) - cint) + expr: (-863.257 - cint) type: double expr: (- csmallint) type: smallint @@ -1291,11 +1291,11 @@ type: smallint expr: (cint / cint) type: double - expr: (((- 863.257) - cint) - (- 26.28)) + expr: ((-863.257 - cint) - -26.28) type: double expr: (- cfloat) type: float - expr: (cdouble * (- 89010)) + expr: (cdouble * -89010) type: double expr: (ctinyint / 988888) type: double @@ -2749,7 +2749,7 @@ type: float expr: (cfloat - (- cfloat)) type: float - expr: ((cfloat - (- cfloat)) % (- 6432)) + expr: ((cfloat - (- cfloat)) % -6432) type: float expr: (cdouble * csmallint) type: double @@ -4549,7 +4549,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (((((csmallint > (- 26.28)) and (cstring2 like 'ss')) or ((cdouble <= cbigint) and ((cstring1 >= 'ss') and (cint <> cdouble)))) or (ctinyint = (- 89010))) or ((cbigint <= cfloat) and ((- 26.28) <= csmallint))) + expr: (((((csmallint > -26.28) and (cstring2 like 'ss')) or ((cdouble <= cbigint) and ((cstring1 >= 'ss') and (cint <> cdouble)))) or (ctinyint = -89010)) or ((cbigint <= cfloat) and (-26.28 <= csmallint))) type: boolean Vectorized execution: true Select Operator @@ -4590,7 +4590,7 @@ type: bigint expr: ((- cdouble) + cbigint) type: double - expr: ((- 1.389) / ctinyint) + expr: (-1.389 / ctinyint) type: double expr: (cbigint % cdouble) type: double @@ -5420,7 +5420,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (((((- 1.389) >= cint) and ((csmallint < ctinyint) and ((- 6432) > csmallint))) or ((cdouble >= cfloat) and (cstring2 <= 'a'))) or ((cstring1 like 'ss%') and (10.175 > cbigint))) + expr: ((((-1.389 >= cint) and ((csmallint < ctinyint) and (-6432 > csmallint))) or ((cdouble >= cfloat) and (cstring2 <= 'a'))) or ((cstring1 like 'ss%') and (10.175 > cbigint))) type: boolean Vectorized execution: true Select Operator @@ -5439,15 +5439,15 @@ type: smallint expr: (cbigint / 3569) type: double - expr: ((- 257) - csmallint) + expr: (-257 - csmallint) type: int - expr: ((- 6432) * cfloat) + expr: (-6432 * cfloat) type: float expr: (- cdouble) type: double expr: (cdouble * 10.175) type: double - expr: (((- 6432) * cfloat) / cfloat) + expr: ((-6432 * cfloat) / cfloat) type: double expr: (- cfloat) type: float @@ -6309,7 +6309,7 @@ alias: alltypesorc Filter Operator predicate: - expr: ((csmallint >= (- 257)) and (((- 6432) = csmallint) or ((cint >= cdouble) and (ctinyint <= cint)))) + expr: ((csmallint >= -257) and ((-6432 = csmallint) or ((cint >= cdouble) and (ctinyint <= cint)))) type: boolean Vectorized execution: true Select Operator @@ -6370,25 +6370,25 @@ expressions: expr: _col0 type: smallint - expr: (_col0 % (- 75)) + expr: (_col0 % -75) type: int expr: _col1 type: double - expr: ((- 1.389) / _col0) + expr: (-1.389 / _col0) type: double expr: _col2 type: bigint - expr: ((_col0 % (- 75)) / _col2) + expr: ((_col0 % -75) / _col2) type: double - expr: (- (_col0 % (- 75))) + expr: (- (_col0 % -75)) type: int expr: _col3 type: double - expr: (- (- (_col0 % (- 75)))) + expr: (- (- (_col0 % -75))) type: int expr: _col4 type: bigint - expr: (_col4 - (- 89010)) + expr: (_col4 - -89010) type: bigint outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 File Output Operator @@ -8024,7 +8024,7 @@ alias: alltypesorc Filter Operator predicate: - expr: ((cdouble > 2563.58) and ((((cbigint >= cint) and ((csmallint < cint) and (cfloat < (- 5638.15)))) or false) or ((cdouble <= cbigint) and ((- 5638.15) > cbigint)))) + expr: ((cdouble > 2563.58) and (((cbigint >= cint) and ((csmallint < cint) and (cfloat < -5638.15))) or ((cdouble <= cbigint) and (-5638.15 > cbigint)))) type: boolean Vectorized execution: true Select Operator @@ -8099,9 +8099,9 @@ type: double expr: _col2 type: bigint - expr: ((2563.58 * _col1) + (- 5638.15)) + expr: ((2563.58 * _col1) + -5638.15) type: double - expr: ((- _col1) * ((2563.58 * _col1) + (- 5638.15))) + expr: ((- _col1) * ((2563.58 * _col1) + -5638.15)) type: double expr: _col3 type: double @@ -8117,7 +8117,7 @@ type: double expr: _col6 type: double - expr: ((- 863.257) % (_col0 * 762)) + expr: (-863.257 % (_col0 * 762)) type: double expr: _col6 type: double @@ -8381,7 +8381,7 @@ alias: alltypesorc Filter Operator predicate: - expr: ((ctimestamp1 <> 0) and ((((((((- 257) <> ctinyint) and cboolean2 is not null) and ((cstring1 rlike '.*ss') and ((- 10669) < ctimestamp1))) or (ctimestamp2 = (- 10669))) or ((ctimestamp1 < 0) and (cstring2 like '%b%'))) or (cdouble = cint)) or (cboolean1 is null and (cfloat < cint)))) + expr: ((ctimestamp1 <> 0) and (((((((-257 <> ctinyint) and cboolean2 is not null) and ((cstring1 rlike '.*ss') and (-10669 < ctimestamp1))) or (ctimestamp2 = -10669)) or ((ctimestamp1 < 0) and (cstring2 like '%b%'))) or (cdouble = cint)) or (cboolean1 is null and (cfloat < cint)))) type: boolean Vectorized execution: true Select Operator @@ -8506,23 +8506,23 @@ type: double expr: (- _col2) type: double - expr: ((- 26.28) - _col2) + expr: (-26.28 - _col2) type: double expr: _col4 type: bigint expr: (- _col4) type: bigint - expr: (((- 26.28) - _col2) * (- _col2)) + expr: ((-26.28 - _col2) * (- _col2)) type: double expr: _col5 type: tinyint - expr: ((((- 26.28) - _col2) * (- _col2)) * (- _col4)) + expr: (((-26.28 - _col2) * (- _col2)) * (- _col4)) type: double expr: (- (_col2 * 10.175)) type: double expr: _col6 type: double - expr: (_col6 + ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) + expr: (_col6 + (((-26.28 - _col2) * (- _col2)) * (- _col4))) type: double expr: (- (- _col2)) type: double @@ -8536,13 +8536,13 @@ type: double expr: _col9 type: double - expr: ((_col6 + ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) - ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) + expr: ((_col6 + (((-26.28 - _col2) * (- _col2)) * (- _col4))) - (((-26.28 - _col2) * (- _col2)) * (- _col4))) type: double expr: (- (- (_col2 * 10.175))) type: double expr: _col10 type: double - expr: (((_col6 + ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) - ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) * 10.175) + expr: (((_col6 + (((-26.28 - _col2) * (- _col2)) * (- _col4))) - (((-26.28 - _col2) * (- _col2)) * (- _col4))) * 10.175) type: double expr: (10.175 % (10.175 / _col3)) type: double @@ -8552,23 +8552,23 @@ type: double expr: _col12 type: double - expr: (- (((- 26.28) - _col2) * (- _col2))) + expr: (- ((-26.28 - _col2) * (- _col2))) type: double expr: ((- _col2) % _col10) type: double - expr: ((- 26.28) / (- _col5)) + expr: (-26.28 / (- _col5)) type: double expr: _col13 type: double expr: _col14 type: bigint - expr: ((_col6 + ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) / _col7) + expr: ((_col6 + (((-26.28 - _col2) * (- _col2)) * (- _col4))) / _col7) type: double expr: (- (- _col4)) type: bigint expr: _col4 type: bigint - expr: ((_col6 + ((((- 26.28) - _col2) * (- _col2)) * (- _col4))) % (- 26.28)) + expr: ((_col6 + (((-26.28 - _col2) * (- _col2)) * (- _col4))) % -26.28) type: double outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30, _col31, _col32, _col33, _col34, _col35, _col36, _col37, _col38 File Output Operator @@ -9040,7 +9040,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (cboolean1 is not null and (((((cdouble < csmallint) and ((cboolean2 = cboolean1) and (cbigint <= (- 863.257)))) or ((cint >= (- 257)) and (cstring1 is not null and (cboolean1 >= 1)))) or (cstring2 rlike 'b')) or ((csmallint >= ctinyint) and ctimestamp2 is null))) + expr: (cboolean1 is not null and (((((cdouble < csmallint) and ((cboolean2 = cboolean1) and (cbigint <= -863.257))) or ((cint >= -257) and (cstring1 is not null and (cboolean1 >= 1)))) or (cstring2 rlike 'b')) or ((csmallint >= ctinyint) and ctimestamp2 is null))) type: boolean Vectorized execution: true Select Operator @@ -9137,7 +9137,7 @@ type: float expr: (- _col1) type: float - expr: ((- 26.28) / _col1) + expr: (-26.28 / _col1) type: double expr: _col2 type: bigint @@ -9169,13 +9169,13 @@ type: bigint expr: _col8 type: double - expr: ((- 1.389) * _col5) + expr: (-1.389 * _col5) type: double - expr: (_col7 - ((- 1.389) * _col5)) + expr: (_col7 - (-1.389 * _col5)) type: double expr: _col9 type: double - expr: (- (_col7 - ((- 1.389) * _col5))) + expr: (- (_col7 - (-1.389 * _col5))) type: double expr: _col10 type: double Index: ql/src/test/results/clientpositive/subquery_exists.q.out =================================================================== --- ql/src/test/results/clientpositive/subquery_exists.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/subquery_exists.q.out (working copy) @@ -95,29 +95,26 @@ 1 handleSkewJoin: false outputColumnNames: _col0, _col1 - Filter Operator - predicate: - expr: (1 = 1) - type: boolean - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator limit: -1 + PREHOOK: query: select * from src b where exists Index: ql/src/test/results/clientpositive/ppd_constant_where.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd_constant_where.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd_constant_where.q.out (working copy) @@ -20,23 +20,19 @@ srcpart TableScan alias: srcpart - Filter Operator - predicate: - expr: ('a' = 'a') - type: boolean - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - outputColumnNames: _col0 - Reduce Output Operator - sort order: - tag: -1 - value expressions: - expr: _col0 - type: bigint + Select Operator + Group By Operator + aggregations: + expr: count() + bucketGroup: false + mode: hash + outputColumnNames: _col0 + Reduce Output Operator + sort order: + tag: -1 + value expressions: + expr: _col0 + type: bigint Reduce Operator Tree: Group By Operator aggregations: Index: ql/src/test/results/clientpositive/udf_ascii.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_ascii.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_ascii.q.out (working copy) @@ -41,11 +41,11 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: ascii('Facebook') + expr: 70 type: int - expr: ascii('') + expr: 0 type: int - expr: ascii('!') + expr: 33 type: int outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/union33.q.out =================================================================== --- ql/src/test/results/clientpositive/union33.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/union33.q.out (working copy) @@ -165,8 +165,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 @@ -437,8 +437,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 0 + type: int expr: value type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/query_result_fileformat.q.out =================================================================== --- ql/src/test/results/clientpositive/query_result_fileformat.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/query_result_fileformat.q.out (working copy) @@ -58,7 +58,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 'key1' type: string expr: value type: string @@ -135,7 +135,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 'key1' type: string expr: value type: string Index: ql/src/test/results/clientpositive/udf_coalesce.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_coalesce.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_coalesce.q.out (working copy) @@ -69,9 +69,9 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: COALESCE(1) + expr: 1 type: int - expr: COALESCE(1,2) + expr: 1 type: int expr: COALESCE(null,2) type: int @@ -81,9 +81,9 @@ type: int expr: COALESCE(4,null,null,null) type: int - expr: COALESCE('1') + expr: '1' type: string - expr: COALESCE('1','2') + expr: '1' type: string expr: COALESCE(null,'2') type: string @@ -93,9 +93,9 @@ type: string expr: COALESCE('4',null,null,null) type: string - expr: COALESCE(1.0) + expr: 1.0 type: double - expr: COALESCE(1.0,2.0) + expr: 1.0 type: double expr: COALESCE(null,2.0) type: double Index: ql/src/test/results/clientpositive/groupby_sort_1.q.out =================================================================== --- ql/src/test/results/clientpositive/groupby_sort_1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/groupby_sort_1.q.out (working copy) @@ -7585,8 +7585,9 @@ Stage-2 is a root stage Stage-0 depends on stages: Stage-2 Stage-3 depends on stages: Stage-0 - Stage-1 depends on stages: Stage-2 - Stage-4 depends on stages: Stage-1 + Stage-4 depends on stages: Stage-2 + Stage-1 depends on stages: Stage-4 + Stage-5 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 @@ -7601,22 +7602,16 @@ type: boolean Select Operator expressions: - expr: key - type: string expr: val type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Select Operator - expressions: - expr: _col0 - type: string - outputColumnNames: _col0 Group By Operator aggregations: expr: count(1) - bucketGroup: true + bucketGroup: false keys: - expr: _col0 + expr: '8' type: string mode: hash outputColumnNames: _col0, _col1 @@ -7634,39 +7629,27 @@ type: bigint Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Group By Operator aggregations: expr: count(1) bucketGroup: false keys: - expr: _col0 + expr: '8' type: string expr: _col1 type: string - mode: final + mode: hash outputColumnNames: _col0, _col1, _col2 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col1 - type: string - expr: UDFToInteger(_col2) - type: int - outputColumnNames: _col0, _col1, _col2 - File Output Operator - compressed: true - GlobalTableId: 2 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest2 + File Output Operator + compressed: true + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe Reduce Operator Tree: Group By Operator aggregations: @@ -7706,6 +7689,57 @@ Stage: Stage-3 Stats-Aggr Operator + Stage: Stage-4 + Map Reduce + Alias -> Map Operator Tree: +#### A masked pattern was here #### + TableScan + Reduce Output Operator + key expressions: + expr: _col0 + type: string + expr: _col1 + type: string + sort order: ++ + Map-reduce partition columns: + expr: _col0 + type: string + expr: _col1 + type: string + tag: -1 + value expressions: + expr: _col2 + type: bigint + Reduce Operator Tree: + Group By Operator + aggregations: + expr: count(VALUE._col0) + bucketGroup: false + keys: + expr: KEY._col0 + type: string + expr: KEY._col1 + type: string + mode: mergepartial + outputColumnNames: _col0, _col1, _col2 + Select Operator + expressions: + expr: UDFToInteger(_col0) + type: int + expr: _col1 + type: string + expr: UDFToInteger(_col2) + type: int + outputColumnNames: _col0, _col1, _col2 + File Output Operator + compressed: true + GlobalTableId: 2 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest2 + Stage: Stage-1 Move Operator tables: @@ -7716,7 +7750,7 @@ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.dest2 - Stage: Stage-4 + Stage: Stage-5 Stats-Aggr Operator Index: ql/src/test/results/clientpositive/select_unquote_not.q.out =================================================================== --- ql/src/test/results/clientpositive/select_unquote_not.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/select_unquote_not.q.out (working copy) @@ -70,7 +70,7 @@ alias: npe_test Filter Operator predicate: - expr: (not (ds < ((2012 - 11) - 31))) + expr: (not (ds < 1970)) type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/num_op_type_conv.q.out =================================================================== --- ql/src/test/results/clientpositive/num_op_type_conv.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/num_op_type_conv.q.out (working copy) @@ -29,11 +29,11 @@ type: double expr: (null + null) type: tinyint - expr: (UDFToLong(21) % UDFToByte(5)) + expr: 1 type: bigint - expr: (UDFToLong(21) % UDFToLong(21)) + expr: 0 type: bigint - expr: (9 % '3') + expr: 0.0 type: double outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Limit Index: ql/src/test/results/clientpositive/input_part5.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part5.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part5.q.out (working copy) @@ -41,7 +41,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/udf_lower.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_lower.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_lower.q.out (working copy) @@ -38,9 +38,9 @@ type: boolean Select Operator expressions: - expr: lower('AbC 123') + expr: 'abc 123' type: string - expr: upper('AbC 123') + expr: 'ABC 123' type: string outputColumnNames: _col0, _col1 File Output Operator Index: ql/src/test/results/clientpositive/index_stale.q.out =================================================================== --- ql/src/test/results/clientpositive/index_stale.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_stale.q.out (working copy) @@ -92,8 +92,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 86 + type: int expr: val type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/input_part0.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part0.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part0.q.out (working copy) @@ -23,7 +23,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/udf_space.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_space.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_space.q.out (working copy) @@ -43,15 +43,15 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: space(10) + expr: ' ' type: string - expr: space(0) + expr: '' type: string - expr: space(1) + expr: ' ' type: string - expr: space((- 1)) + expr: '' type: string - expr: space((- 100)) + expr: '' type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4 ListSink Index: ql/src/test/results/clientpositive/udf_abs.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_abs.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_abs.q.out (working copy) @@ -45,15 +45,15 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: abs(0) + expr: 0 type: int - expr: abs((- 1)) + expr: 1 type: int - expr: abs(123) + expr: 123 type: int - expr: abs((- 9223372036854775807)) + expr: 9223372036854775807 type: bigint - expr: abs(9223372036854775807) + expr: 9223372036854775807 type: bigint outputColumnNames: _col0, _col1, _col2, _col3, _col4 ListSink @@ -108,11 +108,11 @@ Row Limit Per Split: 1 Select Operator expressions: - expr: abs(0.0) + expr: 0.0 type: double - expr: abs((- 3.14159265)) + expr: 3.14159265 type: double - expr: abs(3.14159265) + expr: 3.14159265 type: double outputColumnNames: _col0, _col1, _col2 ListSink Index: ql/src/test/results/clientpositive/ppd2.q.out =================================================================== --- ql/src/test/results/clientpositive/ppd2.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/ppd2.q.out (working copy) @@ -381,8 +381,6 @@ type: string tag: 0 value expressions: - expr: key - type: string expr: value type: string y @@ -409,19 +407,17 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col1} 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4 + outputColumnNames: _col1, _col4 Select Operator expressions: - expr: _col0 - type: string expr: _col1 type: string expr: _col4 type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -445,8 +441,8 @@ type: string tag: -1 value expressions: - expr: _col0 - type: string + expr: 20 + type: int expr: _col1 type: string expr: _col2 Index: ql/src/test/results/clientpositive/input26.q.out =================================================================== --- ql/src/test/results/clientpositive/input26.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input26.q.out (working copy) @@ -34,11 +34,7 @@ type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -50,9 +46,9 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string - expr: _col3 + expr: '11' type: string Reduce Operator Tree: Extract @@ -127,9 +123,9 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string - expr: hr + expr: '14' type: string outputColumnNames: _col0, _col1, _col2, _col3 Limit @@ -141,9 +137,9 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-08' type: string - expr: _col3 + expr: '14' type: string Reduce Operator Tree: Extract Index: ql/src/test/results/clientpositive/subquery_notexists.q.out =================================================================== --- ql/src/test/results/clientpositive/subquery_notexists.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/subquery_notexists.q.out (working copy) @@ -91,7 +91,7 @@ outputColumnNames: _col0, _col1, _col6 Filter Operator predicate: - expr: ((1 = 1) and _col6 is null) + expr: _col6 is null type: boolean Select Operator expressions: @@ -388,7 +388,7 @@ outputColumnNames: _col0, _col1, _col5 Filter Operator predicate: - expr: ((1 = 1) and _col5 is null) + expr: _col5 is null type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/index_stale_partitioned.q.out =================================================================== --- ql/src/test/results/clientpositive/index_stale_partitioned.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_stale_partitioned.q.out (working copy) @@ -120,11 +120,11 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: 86 + type: int expr: val type: string - expr: foo + expr: 'bar' type: string outputColumnNames: _col0, _col1, _col2 File Output Operator Index: ql/src/test/results/clientpositive/udf_parse_url.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_parse_url.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_parse_url.q.out (working copy) @@ -65,28 +65,28 @@ type: boolean Select Operator expressions: - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST') + expr: 'facebook.com' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'PATH') + expr: '/path1/p.php' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY') + expr: 'k1=v1&k2=v2' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'REF') + expr: 'Ref1' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k2') + expr: 'v2' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k1') + expr: 'v1' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k3') + expr: null + type: void + expr: '/path1/p.php?k1=v1&k2=v2' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'FILE') + expr: 'http' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'PROTOCOL') + expr: null + type: void + expr: 'facebook.com' type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'USERINFO') - type: string - expr: parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'AUTHORITY') - type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 File Output Operator compressed: false Index: ql/src/test/results/clientpositive/bucket3.q.out =================================================================== --- ql/src/test/results/clientpositive/bucket3.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/bucket3.q.out (working copy) @@ -221,9 +221,7 @@ type: int expr: value type: string - expr: ds - type: string - outputColumnNames: _col0, _col1, _col2 + outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -235,7 +233,7 @@ type: int expr: _col1 type: string - expr: _col2 + expr: '1' type: string Reduce Operator Tree: Extract Index: ql/src/test/results/clientpositive/smb_mapjoin_25.q.out =================================================================== --- ql/src/test/results/clientpositive/smb_mapjoin_25.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/smb_mapjoin_25.q.out (working copy) @@ -66,9 +66,6 @@ expr: key type: int tag: 0 - value expressions: - expr: key - type: int t1:b TableScan alias: b @@ -90,15 +87,10 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} + 0 1 handleSkewJoin: false - outputColumnNames: _col0 Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 File Output Operator compressed: false GlobalTableId: 0 @@ -114,16 +106,13 @@ TableScan Reduce Output Operator key expressions: - expr: _col0 + expr: 5 type: int sort order: + Map-reduce partition columns: - expr: _col0 + expr: 5 type: int tag: 0 - value expressions: - expr: _col0 - type: int $INTNAME1 TableScan Reduce Output Operator @@ -143,19 +132,19 @@ condition map: Left Outer Join0 to 1 condition expressions: - 0 {VALUE._col0} + 0 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Filter Operator predicate: expr: (_col1 = 5) type: boolean Select Operator expressions: - expr: _col0 + expr: 5 type: int - expr: _col1 + expr: 5 type: int outputColumnNames: _col0, _col1 File Output Operator @@ -185,9 +174,6 @@ expr: key type: int tag: 0 - value expressions: - expr: key - type: int t2:d TableScan alias: d @@ -209,13 +195,12 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} + 0 1 handleSkewJoin: false - outputColumnNames: _col0 Select Operator expressions: - expr: _col0 + expr: 5 type: int outputColumnNames: _col0 File Output Operator @@ -269,31 +254,23 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {key} + 0 1 handleSkewJoin: false keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0 Position of Big Table: 0 Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 Reduce Output Operator key expressions: - expr: _col0 + expr: 5 type: int sort order: + Map-reduce partition columns: - expr: _col0 + expr: 5 type: int tag: 0 - value expressions: - expr: _col0 - type: int t2:c TableScan alias: c @@ -305,17 +282,16 @@ condition map: Inner Join 0 to 1 condition expressions: - 0 {key} + 0 1 handleSkewJoin: false keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0 Position of Big Table: 0 Select Operator expressions: - expr: _col0 + expr: 5 type: int outputColumnNames: _col0 Reduce Output Operator @@ -335,19 +311,19 @@ condition map: Left Outer Join0 to 1 condition expressions: - 0 {VALUE._col0} + 0 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1 + outputColumnNames: _col1 Filter Operator predicate: expr: (_col1 = 5) type: boolean Select Operator expressions: - expr: _col0 + expr: 5 type: int - expr: _col1 + expr: 5 type: int outputColumnNames: _col0, _col1 File Output Operator Index: ql/src/test/results/clientpositive/type_cast_1.q.out =================================================================== --- ql/src/test/results/clientpositive/type_cast_1.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/type_cast_1.q.out (working copy) @@ -19,7 +19,7 @@ alias: src Select Operator expressions: - expr: (if(false, 1, UDFToShort(2)) + 3) + expr: 5 type: int outputColumnNames: _col0 Limit Index: ql/src/test/results/clientpositive/index_auto_unused.q.out =================================================================== --- ql/src/test/results/clientpositive/index_auto_unused.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/index_auto_unused.q.out (working copy) @@ -520,11 +520,7 @@ type: string expr: value type: string - expr: ds - type: string - expr: hr - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 @@ -536,10 +532,10 @@ type: string expr: _col1 type: string - expr: _col2 + expr: '2008-04-09' type: string - expr: _col3 - type: string + expr: 12 + type: int Reduce Operator Tree: Extract File Output Operator Index: ql/src/test/results/clientpositive/input6.q.out =================================================================== --- ql/src/test/results/clientpositive/input6.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input6.q.out (working copy) @@ -37,8 +37,8 @@ type: boolean Select Operator expressions: - expr: key - type: string + expr: null + type: void expr: value type: string outputColumnNames: _col0, _col1 Index: ql/src/test/results/clientpositive/join38.q.out =================================================================== --- ql/src/test/results/clientpositive/join38.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/join38.q.out (working copy) @@ -43,8 +43,8 @@ POSTHOOK: Lineage: tmp.col7 EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: tmp.col8 EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: tmp.col9 EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] -100 101 102.0 103.0 104.0 105 106.0 107.0 108.0 109.0 110.0 111 -100 101 102.0 103.0 104.0 105 106.0 107.0 108.0 109.0 110.0 111 +100 101 102 103 104 105 106 107 108 109 110 111 +100 101 102 103 104 105 106 107 108 109 110 111 PREHOOK: query: explain FROM src a JOIN tmp b ON (a.key = b.col11) SELECT /*+ MAPJOIN(a) */ a.value, b.col5, count(1) as count Index: ql/src/test/results/clientpositive/rand_partitionpruner2.q.out =================================================================== --- ql/src/test/results/clientpositive/rand_partitionpruner2.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/rand_partitionpruner2.q.out (working copy) @@ -47,7 +47,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/stats_empty_dyn_part.q.out =================================================================== --- ql/src/test/results/clientpositive/stats_empty_dyn_part.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/stats_empty_dyn_part.q.out (working copy) @@ -41,7 +41,7 @@ type: boolean Select Operator expressions: - expr: key + expr: 'no_such_value' type: string expr: value type: string Index: ql/src/test/results/clientpositive/constprog_dp.q.out =================================================================== --- ql/src/test/results/clientpositive/constprog_dp.q.out (revision 0) +++ ql/src/test/results/clientpositive/constprog_dp.q.out (revision 0) @@ -0,0 +1,126 @@ +PREHOOK: query: create table dest(key string, value string) partitioned by (ds string) +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table dest(key string, value string) partitioned by (ds string) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@dest +PREHOOK: query: EXPLAIN +from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08' +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08' +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME srcpart))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest) (TOK_PARTSPEC (TOK_PARTVAL ds)))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_TABLE_OR_COL ds))) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '2008-04-08')))) + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-7 depends on stages: Stage-1 , consists of Stage-4, Stage-3, Stage-5 + Stage-4 + Stage-0 depends on stages: Stage-4, Stage-3, Stage-6 + Stage-2 depends on stages: Stage-0 + Stage-3 + Stage-5 + Stage-6 depends on stages: Stage-5 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Alias -> Map Operator Tree: + srcpart + TableScan + alias: srcpart + Select Operator + expressions: + expr: key + type: string + expr: value + type: string + expr: '2008-04-08' + type: string + outputColumnNames: _col0, _col1, _col2 + File Output Operator + compressed: false + GlobalTableId: 1 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest + + Stage: Stage-7 + Conditional Operator + + Stage: Stage-4 + Move Operator + files: + hdfs directory: true +#### A masked pattern was here #### + + Stage: Stage-0 + Move Operator + tables: + partition: + ds + replace: true + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest + + Stage: Stage-2 + Stats-Aggr Operator + + Stage: Stage-3 + Map Reduce + Alias -> Map Operator Tree: +#### A masked pattern was here #### + TableScan + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest + + Stage: Stage-5 + Map Reduce + Alias -> Map Operator Tree: +#### A masked pattern was here #### + TableScan + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest + + Stage: Stage-6 + Move Operator + files: + hdfs directory: true +#### A masked pattern was here #### + + +PREHOOK: query: from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08' +PREHOOK: type: QUERY +PREHOOK: Input: default@srcpart +PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 +PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 +PREHOOK: Output: default@dest +POSTHOOK: query: from srcpart +insert overwrite table dest partition (ds) select key, value, ds where ds='2008-04-08' +POSTHOOK: type: QUERY +POSTHOOK: Input: default@srcpart +POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 +POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 +POSTHOOK: Output: default@dest@ds=2008-04-08 +POSTHOOK: Lineage: dest PARTITION(ds=2008-04-08).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key, type:string, comment:default), ] +POSTHOOK: Lineage: dest PARTITION(ds=2008-04-08).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value, type:string, comment:default), ] Index: ql/src/test/results/clientpositive/udf_isnull_isnotnull.q.out =================================================================== --- ql/src/test/results/clientpositive/udf_isnull_isnotnull.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/udf_isnull_isnotnull.q.out (working copy) @@ -45,21 +45,17 @@ Processor Tree: TableScan alias: src - Filter Operator - predicate: - expr: true is not null - type: boolean - Select Operator - expressions: - expr: null is null - type: boolean - expr: 1 is not null - type: boolean - expr: 'my string' is not null - type: boolean - outputColumnNames: _col0, _col1, _col2 - Limit - ListSink + Select Operator + expressions: + expr: null is null + type: boolean + expr: true + type: boolean + expr: true + type: boolean + outputColumnNames: _col0, _col1, _col2 + Limit + ListSink PREHOOK: query: SELECT NULL IS NULL, Index: ql/src/test/results/clientpositive/column_access_stats.q.out =================================================================== --- ql/src/test/results/clientpositive/column_access_stats.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/column_access_stats.q.out (working copy) @@ -638,8 +638,6 @@ value expressions: expr: key type: string - expr: val - type: string t2 TableScan alias: t2 @@ -659,28 +657,22 @@ value expressions: expr: key type: string - expr: val - type: string Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} + 0 {VALUE._col0} + 1 {VALUE._col0} handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5 + outputColumnNames: _col0, _col4 Select Operator expressions: expr: _col0 type: string - expr: _col1 - type: string expr: _col4 type: string - expr: _col5 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 + outputColumnNames: _col0, _col2 File Output Operator compressed: false GlobalTableId: 0 @@ -698,19 +690,19 @@ key expressions: expr: _col0 type: string - expr: _col1 - type: string + expr: 3 + type: int sort order: ++ tag: -1 value expressions: expr: _col0 type: string - expr: _col1 - type: string + expr: 3 + type: int expr: _col2 type: string - expr: _col3 - type: string + expr: 3 + type: int Reduce Operator Tree: Extract File Output Operator Index: ql/src/test/results/clientpositive/input_part7.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part7.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part7.q.out (working copy) @@ -40,7 +40,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string @@ -93,7 +93,7 @@ type: string expr: value type: string - expr: ds + expr: '2008-04-08' type: string expr: hr type: string Index: ql/src/test/results/clientpositive/input_part2.q.out =================================================================== --- ql/src/test/results/clientpositive/input_part2.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/input_part2.q.out (working copy) @@ -57,9 +57,9 @@ type: int expr: value type: string - expr: hr + expr: '12' type: string - expr: ds + expr: '2008-04-08' type: string outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator @@ -97,9 +97,9 @@ type: int expr: value type: string - expr: hr + expr: '12' type: string - expr: ds + expr: '2008-04-09' type: string outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator Index: ql/src/test/results/clientpositive/select_unquote_and.q.out =================================================================== --- ql/src/test/results/clientpositive/select_unquote_and.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/select_unquote_and.q.out (working copy) @@ -70,7 +70,7 @@ alias: npe_test Filter Operator predicate: - expr: ((ds > ((2012 - 11) - 31)) and (ds < ((2012 - 12) - 15))) + expr: ((ds > 1970) and (ds < 1985)) type: boolean Select Operator expressions: Index: ql/src/test/results/clientpositive/vectorized_math_funcs.q.out =================================================================== --- ql/src/test/results/clientpositive/vectorized_math_funcs.q.out (revision 1541356) +++ ql/src/test/results/clientpositive/vectorized_math_funcs.q.out (working copy) @@ -118,7 +118,7 @@ alias: alltypesorc Filter Operator predicate: - expr: (((cbigint % 500) = 0) and (sin(cfloat) >= (- 1.0))) + expr: (((cbigint % 500) = 0) and (sin(cfloat) >= -1.0)) type: boolean Vectorized execution: true Select Operator Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java =================================================================== --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 1541356) +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy) @@ -838,7 +838,9 @@ // none, idonly, traverse, execution HIVESTAGEIDREARRANGE("hive.stageid.rearrange", "none"), - HIVEEXPLAINDEPENDENCYAPPENDTASKTYPES("hive.explain.dependency.append.tasktype", false), + HIVEEXPLAINDEPENDENCYAPPENDTASKTYPES("hive.explain.dependency.append.tasktype", false), + + HIVEOPTCONSTANTPROG("hive.optimize.constant.propagation", true), ; public final String varname;