Search in sources :

Example 1 with ScriptOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator in project asterixdb by apache.

the class LogicalOperatorDeepCopyWithNewVariablesVisitor method visitScriptOperator.

@Override
public ILogicalOperator visitScriptOperator(ScriptOperator op, ILogicalOperator arg) throws AlgebricksException {
    ScriptOperator opCopy = new ScriptOperator(op.getScriptDescription(), deepCopyVariableList(op.getInputVariables()), deepCopyVariableList(op.getOutputVariables()));
    deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy);
    return opCopy;
}
Also used : ScriptOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator)

Example 2 with ScriptOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator in project asterixdb by apache.

the class StringStreamingScriptPOperator method computeDeliveredProperties.

@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
    ScriptOperator s = (ScriptOperator) op;
    computeDeliveredPropertiesForUsedVariables(s, s.getInputVariables());
}
Also used : ScriptOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator)

Example 3 with ScriptOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator in project asterixdb by apache.

the class StringStreamingScriptPOperator method contributeRuntimeOperator.

@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);
}
Also used : StringStreamingScriptDescription(org.apache.hyracks.algebricks.core.algebra.scripting.StringStreamingScriptDescription) RecordDescriptor(org.apache.hyracks.api.dataflow.value.RecordDescriptor) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) ScriptOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator) IScriptDescription(org.apache.hyracks.algebricks.core.algebra.scripting.IScriptDescription) StringStreamingRuntimeFactory(org.apache.hyracks.algebricks.runtime.operators.std.StringStreamingRuntimeFactory)

Example 4 with ScriptOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator in project asterixdb by apache.

the class IsomorphismOperatorVisitor method visitScriptOperator.

@Override
public Boolean visitScriptOperator(ScriptOperator op, ILogicalOperator arg) throws AlgebricksException {
    AbstractLogicalOperator aop = (AbstractLogicalOperator) arg;
    if (aop.getOperatorTag() != LogicalOperatorTag.SCRIPT) {
        return Boolean.FALSE;
    }
    ScriptOperator scriptOpArg = (ScriptOperator) copyAndSubstituteVar(op, arg);
    boolean isomorphic = op.getScriptDescription().equals(scriptOpArg.getScriptDescription());
    return isomorphic;
}
Also used : AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) ScriptOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator)

Aggregations

ScriptOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.ScriptOperator)4 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)1 AbstractLogicalOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator)1 IScriptDescription (org.apache.hyracks.algebricks.core.algebra.scripting.IScriptDescription)1 StringStreamingScriptDescription (org.apache.hyracks.algebricks.core.algebra.scripting.StringStreamingScriptDescription)1 StringStreamingRuntimeFactory (org.apache.hyracks.algebricks.runtime.operators.std.StringStreamingRuntimeFactory)1 RecordDescriptor (org.apache.hyracks.api.dataflow.value.RecordDescriptor)1