/** * Create the list of internal columns for select tag of LV */ public List<FieldNode> getSelectColsFromLVJoin(RowSchema rs, List<FieldNode> colList) throws SemanticException { List<FieldNode> columns = new ArrayList<>(); for (FieldNode col : colList) { if (rs.getColumnInfo(col.getFieldName()) != null) { columns.add(col); } } return columns; }
/** * Create the list of internal columns for select tag of LV */ public List<FieldNode> getSelectColsFromLVJoin(RowSchema rs, List<FieldNode> colList) throws SemanticException { List<FieldNode> columns = new ArrayList<>(); for (FieldNode col : colList) { if (rs.getColumnInfo(col.getFieldName()) != null) { columns.add(col); } } return columns; }
/** * Get ColumnInfo from column expression. * * @param rr * @param desc * @return */ public static ColumnInfo resolveColumn(RowSchema rs, ExprNodeColumnDesc desc) { ColumnInfo ci = rs.getColumnInfo(desc.getTabAlias(), desc.getColumn()); if (ci == null) { ci = rs.getColumnInfo(desc.getColumn()); } if (ci == null) { return null; } return ci; }
/** * Get ColumnInfo from column expression. * * @param rr * @param desc * @return */ public static ColumnInfo resolveColumn(RowSchema rs, ExprNodeColumnDesc desc) { ColumnInfo ci = rs.getColumnInfo(desc.getTabAlias(), desc.getColumn()); if (ci == null) { ci = rs.getColumnInfo(desc.getColumn()); } if (ci == null) { return null; } return ci; }
if (rowSchema.getColumnInfo(pair.getKey()) == null) { ColStatistics colStat = getColStatisticsFromExpression(conf, parentStats, pair.getValue()); if (colStat != null) {
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { ExprNodeColumnDesc cd = (ExprNodeColumnDesc) nd; ExprProcCtx epc = (ExprProcCtx) procCtx; // assert that the input operator is not null as there are no // exprs associated with table scans. Operator<? extends OperatorDesc> operator = epc.getInputOperator(); assert (operator != null); RowSchema schema = epc.getSchema(); ColumnInfo ci = schema.getColumnInfo(cd.getColumn()); if (ci == null && operator instanceof ReduceSinkOperator) { ci = schema.getColumnInfo(Utilities.removeValueTag(cd.getColumn())); } // Insert the dependencies of inp_ci to that of the current operator, ci LineageCtx lc = epc.getLineageCtx(); Dependency dep = lc.getIndex().getDependency(operator, ci); return dep; }
ColumnInfo columnInfo = reduceSinkOp.getSchema().getColumnInfo(columnInternalName); return new ExprNodeColumnDesc(columnInfo); } else {
ConstantPropagateProcCtx cppCtx, Operator<? extends Serializable> parent) { RowSchema rs = parent.getSchema(); ColumnInfo ci = rs.getColumnInfo(desc.getColumn()); if (ci == null) { if (LOG.isErrorEnabled()) { LOG.error("Reverse look up of column " + desc + " error!"); ci = rs.getColumnInfo(desc.getTabAlias(), desc.getColumn());
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { ExprNodeColumnDesc cd = (ExprNodeColumnDesc) nd; ExprProcCtx epc = (ExprProcCtx) procCtx; // assert that the input operator is not null as there are no // exprs associated with table scans. Operator<? extends OperatorDesc> operator = epc.getInputOperator(); assert (operator != null); RowSchema schema = epc.getSchema(); ColumnInfo ci = schema.getColumnInfo(cd.getColumn()); if (ci == null && operator instanceof ReduceSinkOperator) { ci = schema.getColumnInfo(Utilities.removeValueTag(cd.getColumn())); } // Insert the dependencies of inp_ci to that of the current operator, ci LineageCtx lc = epc.getLineageCtx(); Dependency dep = lc.getIndex().getDependency(operator, ci); return dep; }
if (source instanceof ExprNodeColumnDesc) { ColumnInfo columnInfo = reduceSinkOp.getSchema().getColumnInfo(columnInternalName); return new ExprNodeColumnDesc(columnInfo); } else {
ColumnInfo colInfo = inputRS.getColumnInfo(column); if (colInfo == null) { continue;
ExprNodeDesc outputColExpr = valueExprs.get(i); if (!retainFlags[i]) { ColumnInfo colInfo = oldRS.getColumnInfo(outputCol); if (colInfo == null) { outputCol = Utilities.ReduceField.VALUE.toString() + "." + outputCol; colInfo = oldRS.getColumnInfo(outputCol);
for (FieldNode col : cols) { ColumnInfo colInfo = rs.getColumnInfo(col.getFieldName()); ExprNodeColumnDesc colExpr = new ExprNodeColumnDesc(colInfo); colList.add(colExpr);
for (FieldNode internalCol: prunedCols) { String internalName = internalCol.getFieldName(); ColumnInfo valueInfo = inputRS.getColumnInfo(internalName); ExprNodeDesc colDesc = new ExprNodeColumnDesc(valueInfo.getType(), valueInfo.getInternalName(), valueInfo.getTabAlias(), valueInfo.getIsVirtualCol());
ColumnInfo valueInfo = inputRS.getColumnInfo(internalName); ExprNodeDesc colDesc = new ExprNodeColumnDesc(valueInfo.getType(), valueInfo .getInternalName(), valueInfo.getTabAlias(), valueInfo.getIsVirtualCol());
for (int i = 0; i < keyCols.size(); i++) { ColumnInfo column = schema.getColumnInfo(Utilities.ReduceField.KEY + "." + keyColNames.get(i)); if (column == null) { continue; // key in values for (int i = 0; i < valCols.size(); i++) { ColumnInfo column = schema.getColumnInfo(valColNames.get(i)); if (column == null) { column = schema.getColumnInfo(Utilities.ReduceField.VALUE + "." + valColNames.get(i));
String alias = internalName; String tabAlias = col.getTabAlias(); ColumnInfo ci = rs.getColumnInfo(internalName); if (ci != null) { if (ci.getAlias() != null) { ci = inpOp.getSchema().getColumnInfo(internalName); if (ci != null && ci.getAlias() != null) { alias = ci.getAlias();
ColumnInfo valueInfo = inputRS.getColumnInfo(internalName); ExprNodeDesc colDesc = new ExprNodeColumnDesc(valueInfo.getType(), valueInfo .getInternalName(), valueInfo.getTabAlias(), valueInfo.getIsVirtualCol());
@SuppressWarnings("unchecked") @Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { // Assert that there is at least one item in the stack. This should never // be called for leafs. assert(!stack.isEmpty()); // LineageCtx LineageCtx lCtx = (LineageCtx) procCtx; Operator<? extends OperatorDesc> op = (Operator<? extends OperatorDesc>)nd; // Get the row schema of the input operator. // The row schema of the parent operator Operator<? extends OperatorDesc> inpOp = getParent(stack); lCtx.getIndex().copyPredicates(inpOp, op); RowSchema rs = op.getSchema(); ArrayList<ColumnInfo> inp_cols = inpOp.getSchema().getSignature(); // check only for input cols for(ColumnInfo input : inp_cols) { Dependency inp_dep = lCtx.getIndex().getDependency(inpOp, input); if (inp_dep != null) { //merge it with rs colInfo ColumnInfo ci = rs.getColumnInfo(input.getInternalName()); lCtx.getIndex().mergeDependency(op, ci, inp_dep); } } return null; } }
for (int i = 0; i < outputCols.size(); i++) { String colName = outputCols.get(i); ColumnInfo colInfo = oldRS.getColumnInfo(colName); newRS.add(colInfo); ExprNodeDesc colExpr = ExprNodeDescUtils.backtrack(oldMap.get(colName), cGBYr, cRS);