@Override public boolean isSame(OperatorDesc other) { if (getClass().getName().equals(other.getClass().getName())) { SelectDesc otherDesc = (SelectDesc) other; return Objects.equals(getColListString(), otherDesc.getColListString()) && Objects.equals(getOutputColumnNames(), otherDesc.getOutputColumnNames()) && Objects.equals(explainNoCompute(), otherDesc.explainNoCompute()); } return false; }
@Override public Object clone() { SelectDesc ret = new SelectDesc(); ret.setColList(getColList() == null ? null : new ArrayList<ExprNodeDesc>(getColList())); ret.setOutputColumnNames(getOutputColumnNames() == null ? null : new ArrayList<String>(getOutputColumnNames())); ret.setSelectStar(selectStar); ret.setSelStarNoCompute(selStarNoCompute); return ret; }
@Override public Object clone() { SelectDesc ret = new SelectDesc(); ret.setColList(getColList() == null ? null : new ArrayList<ExprNodeDesc>(getColList())); ret.setOutputColumnNames(getOutputColumnNames() == null ? null : new ArrayList<String>(getOutputColumnNames())); ret.setSelectStar(selectStar); ret.setSelStarNoCompute(selStarNoCompute); return ret; }
if (!selectDesc.isSelStarNoCompute()) { colList = selectDesc.getColList(); outputColNames = selectDesc.getOutputColumnNames();
if (!selectDesc.isSelStarNoCompute()) { colList = selectDesc.getColList(); outputColNames = selectDesc.getOutputColumnNames();
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); // Just forward the row as is if (conf.isSelStarNoCompute()) { isSelectStarNoCompute = true; return; } List<ExprNodeDesc> colList = conf.getColList(); eval = new ExprNodeEvaluator[colList.size()]; for (int i = 0; i < colList.size(); i++) { assert (colList.get(i) != null); eval[i] = ExprNodeEvaluatorFactory.get(colList.get(i), hconf); } if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEEXPREVALUATIONCACHE)) { eval = ExprNodeEvaluatorFactory.toCachedEvals(eval); } output = new Object[eval.length]; if (LOG.isInfoEnabled()) { LOG.info("SELECT " + inputObjInspectors[0].getTypeName()); } outputObjInspector = initEvaluatorsAndReturnStruct(eval, conf.getOutputColumnNames(), inputObjInspectors[0]); }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); // Just forward the row as is if (conf.isSelStarNoCompute()) { return; } List<ObjectInspector> objectInspectors = new ArrayList<ObjectInspector>(); List<ExprNodeDesc> colList = conf.getColList(); valueWriters = VectorExpressionWriterFactory.getExpressionWriters(colList); for (VectorExpressionWriter vew : valueWriters) { objectInspectors.add(vew.getObjectInspector()); } List<String> outputFieldNames = conf.getOutputColumnNames(); outputObjInspector = ObjectInspectorFactory.getStandardStructObjectInspector( outputFieldNames, objectInspectors); }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); // Just forward the row as is if (conf.isSelStarNoCompute()) { isSelectStarNoCompute = true; return; } List<ExprNodeDesc> colList = conf.getColList(); eval = new ExprNodeEvaluator[colList.size()]; for (int i = 0; i < colList.size(); i++) { assert (colList.get(i) != null); eval[i] = ExprNodeEvaluatorFactory.get(colList.get(i), hconf); } if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEEXPREVALUATIONCACHE)) { eval = ExprNodeEvaluatorFactory.toCachedEvals(eval); } output = new Object[eval.length]; if (isLogInfoEnabled) { LOG.info("SELECT " + inputObjInspectors[0].getTypeName()); } outputObjInspector = initEvaluatorsAndReturnStruct(eval, conf.getOutputColumnNames(), inputObjInspectors[0]); }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); // Just forward the row as is if (conf.isSelStarNoCompute()) { return; } VectorExpression.doTransientInit(vExpressions); List<ObjectInspector> objectInspectors = new ArrayList<ObjectInspector>(); List<ExprNodeDesc> colList = conf.getColList(); valueWriters = VectorExpressionWriterFactory.getExpressionWriters(colList); for (VectorExpressionWriter vew : valueWriters) { objectInspectors.add(vew.getObjectInspector()); } List<String> outputFieldNames = conf.getOutputColumnNames(); outputObjInspector = ObjectInspectorFactory.getStandardStructObjectInspector( outputFieldNames, objectInspectors); }
foldOperator(op, cppCtx); List<ExprNodeDesc> colList = op.getConf().getColList(); List<String> columnNames = op.getConf().getOutputColumnNames(); Map<String, ExprNodeDesc> columnExprMap = op.getColumnExprMap(); if (colList != null) {
foldOperator(op, cppCtx); List<ExprNodeDesc> colList = op.getConf().getColList(); List<String> columnNames = op.getConf().getOutputColumnNames(); Map<String, ExprNodeDesc> columnExprMap = op.getColumnExprMap(); if (colList != null) {
public VectorSelectOperator(CompilationOpContext ctx, OperatorDesc conf, VectorizationContext vContext, VectorDesc vectorDesc) throws HiveException { this(ctx); this.conf = (SelectDesc) conf; this.vContext = vContext; this.vectorDesc = (VectorSelectDesc) vectorDesc; vExpressions = this.vectorDesc.getSelectExpressions(); projectedOutputColumns = this.vectorDesc.getProjectedOutputColumns(); /** * Create a new vectorization context to create a new projection, but keep * same output column manager must be inherited to track the scratch the columns. * Some of which may be the input columns for this operator. */ vOutContext = new VectorizationContext(getName(), vContext); // NOTE: We keep the TypeInfo and dataTypePhysicalVariation arrays. vOutContext.resetProjectionColumns(); List<String> outputColumnNames = this.conf.getOutputColumnNames(); for (int i=0; i < projectedOutputColumns.length; ++i) { String columnName = outputColumnNames.get(i); vOutContext.addProjectionColumn(columnName, projectedOutputColumns[i]); } }
List<String> outputColumnNames = conf.getOutputColumnNames(); for (int i = 0; i < outputColumnNames.size(); i++) { if (colList == null) {
@Override public boolean equals(VectorSelectOperator op1, VectorSelectOperator op2) { Preconditions.checkNotNull(op1); Preconditions.checkNotNull(op2); SelectDesc op1Conf = op1.getConf(); SelectDesc op2Conf = op2.getConf(); if (compareString(op1Conf.getColListString(), op2Conf.getColListString()) && compareObject(op1Conf.getOutputColumnNames(), op2Conf.getOutputColumnNames()) && compareString(op1Conf.explainNoCompute(), op2Conf.explainNoCompute())) { return true; } else { return false; } } }
public VectorSelectOperator(CompilationOpContext ctx, VectorizationContext vContext, OperatorDesc conf) throws HiveException { this(ctx); this.conf = (SelectDesc) conf; vectorDesc = (VectorSelectDesc) this.conf.getVectorDesc(); vExpressions = vectorDesc.getSelectExpressions(); projectedOutputColumns = vectorDesc.getProjectedOutputColumns(); /** * Create a new vectorization context to create a new projection, but keep * same output column manager must be inherited to track the scratch the columns. */ vOutContext = new VectorizationContext(getName(), vContext); vOutContext.resetProjectionColumns(); List<String> outputColumnNames = this.conf.getOutputColumnNames(); for (int i=0; i < projectedOutputColumns.length; ++i) { String columnName = outputColumnNames.get(i); vOutContext.addProjectionColumn(columnName, projectedOutputColumns[i]); } }
List<String> outputColumnNames = conf.getOutputColumnNames(); for (int i = 0; i < outputColumnNames.size(); i++) { if (colList == null) {
@Override public boolean equals(SelectOperator op1, SelectOperator op2) { Preconditions.checkNotNull(op1); Preconditions.checkNotNull(op2); SelectDesc op1Conf = op1.getConf(); SelectDesc op2Conf = op2.getConf(); if (compareString(op1Conf.getColListString(), op2Conf.getColListString()) && compareObject(op1Conf.getOutputColumnNames(), op2Conf.getOutputColumnNames()) && compareString(op1Conf.explainNoCompute(), op2Conf.explainNoCompute())) { return true; } else { return false; } } }
pSEL.getConf().getOutputColumnNames(), pSEL.getConf().getColList()); List<String> cSELOutputColumnNames = cSEL.getConf().getOutputColumnNames(); if (!funcOutputs.isEmpty() && !checkReferences(cSELColList, funcOutputs)) { return null;
pSEL.getConf().getOutputColumnNames(), pSEL.getConf().getColList()); List<String> cSELOutputColumnNames = cSEL.getConf().getOutputColumnNames(); if (!funcOutputs.isEmpty() && !checkReferences(cSELColList, funcOutputs)) { return null;
/** * This method replaces the original SelectOperator with the new * SelectOperator with a new column indexed_key_column. */ private void replaceSelectOperatorProcess(SelectOperator operator) throws SemanticException { RewriteQueryUsingAggregateIndexCtx rewriteQueryCtx = this; // we need to set the colList, outputColumnNames, colExprMap, // rowSchema for only that SelectOperator which precedes the GroupByOperator // count(indexed_key_column) needs to be replaced by // sum(`_count_of_indexed_key_column`) List<ExprNodeDesc> selColList = operator.getConf().getColList(); selColList.add(rewriteQueryCtx.getAggrExprNode()); List<String> selOutputColNames = operator.getConf().getOutputColumnNames(); selOutputColNames.add(rewriteQueryCtx.getAggrExprNode().getColumn()); operator.getColumnExprMap().put(rewriteQueryCtx.getAggrExprNode().getColumn(), rewriteQueryCtx.getAggrExprNode()); RowSchema selRS = operator.getSchema(); List<ColumnInfo> selRSSignature = selRS.getSignature(); // Need to create a new type for Column[_count_of_indexed_key_column] node PrimitiveTypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo("bigint"); pti.setTypeName("bigint"); ColumnInfo newCI = new ColumnInfo(rewriteQueryCtx.getAggregateFunction(), pti, "", false); selRSSignature.add(newCI); selRS.setSignature((ArrayList<ColumnInfo>) selRSSignature); operator.setSchema(selRS); }