@Override public void contributeRuntimeOperator( IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) throws AlgebricksException { ScriptOperator scriptOp = (ScriptOperator) op; IScriptDescription scriptDesc = scriptOp.getScriptDescription(); if (scriptDesc.getKind() != ScriptKind.STRING_STREAMING) { throw new IllegalStateException(); } StringStreamingScriptDescription sssd = (StringStreamingScriptDescription) scriptDesc; StringStreamingRuntimeFactory runtime = new StringStreamingRuntimeFactory( sssd.getCommand(), sssd.getPrinterFactories(), sssd.getFieldDelimiter(), sssd.getParserFactory()); RecordDescriptor recDesc = JobGenHelper.mkRecordDescriptor(context.getTypeEnvironment(op), propagatedSchema, context); builder.contributeMicroOperator(scriptOp, runtime, recDesc); // and contribute one edge from its child ILogicalOperator src = scriptOp.getInputs().get(0).getValue(); builder.contributeGraphEdge(src, 0, scriptOp, 0); }
@Override public Void visitScriptOperator(ScriptOperator op, Pair<LogicalVariable, LogicalVariable> pair) throws AlgebricksException { substInArray(op.getInputVariables(), pair.first, pair.second); substInArray(op.getOutputVariables(), pair.first, pair.second); substVarTypes(op, pair); return null; }
@Override public Void visitScriptOperator(ScriptOperator op, Void arg) throws AlgebricksException { schemaVariables.addAll(op.getOutputVariables()); return null; }
@Override public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) { ScriptOperator s = (ScriptOperator) op; computeDeliveredPropertiesForUsedVariables(s, s.getInputVariables()); }