@Explain(displayName = "SELECT * ") public String explainNoCompute() { if (isSelStarNoCompute()) { return "(no compute)"; } else { return null; } }
@Signature @Explain(displayName = "SELECT * ") public String explainNoCompute() { if (isSelStarNoCompute()) { return "(no compute)"; } else { return null; } }
if (!selectDesc.isSelStarNoCompute()) { colList = selectDesc.getColList(); outputColNames = selectDesc.getOutputColumnNames();
if (!selectDesc.isSelStarNoCompute()) { colList = selectDesc.getColList(); outputColNames = selectDesc.getOutputColumnNames();
private boolean checkExpressions(SelectOperator op) { SelectDesc desc = op.getConf(); if (desc.isSelectStar() || desc.isSelStarNoCompute()) { return true; } for (ExprNodeDesc expr : desc.getColList()) { if (!checkExpression(expr)) { return false; } } return true; }
@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]); }
private boolean checkExpressions(SelectOperator op) { SelectDesc desc = op.getConf(); if (desc.isSelectStar() || desc.isSelStarNoCompute()) { return true; } for (ExprNodeDesc expr : desc.getColList()) { if (!checkExpression(expr)) { return false; } } return true; }
@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); }
/** * Creates the list of internal column names (represented by field nodes) * from select expressions in a select operator. This function is used for the * select operator instead of the genColLists function (which is used by * the rest of the operators). * * @param op The select operator. * @return a list of field nodes representing the internal column names. */ public List<FieldNode> getColsFromSelectExpr(SelectOperator op) { List<FieldNode> cols = new ArrayList<>(); SelectDesc conf = op.getConf(); if(conf.isSelStarNoCompute()) { for (ColumnInfo colInfo : op.getSchema().getSignature()) { cols.add(new FieldNode(colInfo.getInternalName())); } } else { List<ExprNodeDesc> exprList = conf.getColList(); for (ExprNodeDesc expr : exprList) { cols = mergeFieldNodesWithDesc(cols, expr); } } return cols; }
SelectDesc conf = op.getConf(); if (colList != null && conf.isSelStarNoCompute()) { cols.addAll(colList); return cols;
@Override public void process(Object row, int tag) throws HiveException { // Just forward the row as is if (conf.isSelStarNoCompute()) { vectorForward((VectorizedRowBatch) row); return; } VectorizedRowBatch vrg = (VectorizedRowBatch) row; for (int i = 0; i < vExpressions.length; i++) { try { vExpressions[i].evaluate(vrg); } catch (RuntimeException e) { throw new HiveException("Error evaluating " + conf.getColList().get(i).getExprString(), e); } } // Prepare output, set the projections int[] originalProjections = vrg.projectedColumns; int originalProjectionSize = vrg.projectionSize; vrg.projectionSize = projectedOutputColumns.length; vrg.projectedColumns = this.projectedOutputColumns; vectorForward((VectorizedRowBatch) row); // Revert the projected columns back, because vrg will be re-used. vrg.projectionSize = originalProjectionSize; vrg.projectedColumns = originalProjections; }
/** * Creates the list of internal column names (represented by field nodes) * from select expressions in a select operator. This function is used for the * select operator instead of the genColLists function (which is used by * the rest of the operators). * * @param op The select operator. * @return a list of field nodes representing the internal column names. */ public List<FieldNode> getColsFromSelectExpr(SelectOperator op) { List<FieldNode> cols = new ArrayList<>(); SelectDesc conf = op.getConf(); if(conf.isSelStarNoCompute()) { for (ColumnInfo colInfo : op.getSchema().getSignature()) { cols.add(new FieldNode(colInfo.getInternalName())); } } else { List<ExprNodeDesc> exprList = conf.getColList(); for (ExprNodeDesc expr : exprList) { cols = mergeFieldNodesWithDesc(cols, expr); } } return cols; }
@Override public void process(Object row, int tag) throws HiveException { // Just forward the row as is if (conf.isSelStarNoCompute()) { forward(row, inputObjInspectors[tag]); return; } VectorizedRowBatch vrg = (VectorizedRowBatch) row; for (int i = 0; i < vExpressions.length; i++) { try { vExpressions[i].evaluate(vrg); } catch (RuntimeException e) { throw new HiveException("Error evaluating " + conf.getColList().get(i).getExprString(), e); } } // Prepare output, set the projections int[] originalProjections = vrg.projectedColumns; int originalProjectionSize = vrg.projectionSize; vrg.projectionSize = projectedOutputColumns.length; vrg.projectedColumns = this.projectedOutputColumns; forward(vrg, outputObjInspector); // Revert the projected columns back, because vrg will be re-used. vrg.projectionSize = originalProjectionSize; vrg.projectedColumns = originalProjections; }
if(conf.isSelStarNoCompute()) { return true;
if (sop.getConf().isSelStarNoCompute()) { processForward(sop, bctx, parent); return null;
if (sop.getConf().isSelStarNoCompute()) { processForward(sop, bctx, parent); return null;
if (sop.getConf().isSelStarNoCompute()) { return super.process(nd, stack, procCtx, nodeOutputs);
stats.setColumnStats(colStats); if (!sop.getConf().isSelectStar() && !sop.getConf().isSelStarNoCompute()) { long dataSize = StatsUtils.getDataSizeFromColumnStats(stats.getNumRows(), colStats); stats.setDataSize(dataSize);