private Void visitUnnestNonMapOperator(AbstractUnnestNonMapOperator op) { producedVariables.addAll(op.getVariables()); LogicalVariable positionalVariable = op.getPositionalVariable(); if (positionalVariable != null) { if (!producedVariables.contains(positionalVariable)) { producedVariables.add(positionalVariable); } } return null; } }
public AbstractUnnestNonMapOperator(LogicalVariable variable, Mutable<ILogicalExpression> expression) { super(makeSingletonList(variable), expression); }
public AbstractUnnestNonMapOperator(LogicalVariable variable, Mutable<ILogicalExpression> expression, LogicalVariable positionalVariable, Object positionalVariableType, IUnnestingPositionWriter positionWriter) { this(variable, expression); this.setPositionalVariable(positionalVariable); this.setPositionalVariableType(positionalVariableType); this.setPositionWriter(positionWriter); }
throws AlgebricksException { AbstractUnnestNonMapOperator unnest = (AbstractUnnestNonMapOperator) op; int outCol = opSchema.findVariable(unnest.getVariable()); ILogicalExpression unnestExpr = unnest.getExpressionRef().getValue(); IExpressionRuntimeProvider expressionRuntimeProvider = context.getExpressionRuntimeProvider(); boolean exit = false; int[] projectionList = JobGenHelper.projectAllVariables(opSchema); UnnestRuntimeFactory unnestRuntime = new UnnestRuntimeFactory(outCol, unnestingFactory, projectionList, unnest.getPositionWriter(), leftOuter, context.getMissingWriterFactory()); unnestRuntime.setSourceLocation(unnest.getSourceLocation()); RecordDescriptor recDesc = JobGenHelper.mkRecordDescriptor(context.getTypeEnvironment(op), opSchema, context); builder.contributeMicroOperator(unnest, unnestRuntime, recDesc); ILogicalOperator src = unnest.getInputs().get(0).getValue(); builder.contributeGraphEdge(src, 0, unnest, 0);
boolean hasRightPosVar = rightUnnestOp.getPositionalVariable() != null; if (hasRightPosVar) { new VariableReferenceExpression(rightUnnestOp.getVariable()); rightUnnestVarRef.setSourceLocation(joinClause.getRightVariable().getSourceLocation()); VariableReferenceExpression rightUnnestPosVarRef = new VariableReferenceExpression(rightUnnestOp.getPositionalVariable()); rightUnnestPosVarRef.setSourceLocation(joinClause.getPositionalVariable().getSourceLocation()); ScalarFunctionCallExpression recordCreationFunc = new ScalarFunctionCallExpression( varToListify = recordVar; } else { varToListify = rightUnnestOp.getVariable();
private Void visitUnnestNonMapOperator(AbstractUnnestNonMapOperator op, Pair<LogicalVariable, LogicalVariable> pair) throws AlgebricksException { List<LogicalVariable> variables = op.getVariables(); for (int i = 0; i < variables.size(); i++) { if (variables.get(i) == pair.first) { variables.set(i, pair.second); return null; } } op.getExpressionRef().getValue().substituteVar(pair.first, pair.second); substVarTypes(op, pair); return null; }