[ 
https://issues.apache.org/jira/browse/JENA-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17255239#comment-17255239
 ] 

Andy Seaborne commented on JENA-2020:
-------------------------------------

Look at the current code for inspiration: {{OpFilter}} for example or another 
{{Op1}}.

{{input}} is passed from outside e.g. {{OpSequence}}. If the query is purely 
bottom-up at this point, it will be the root which is one row, no bindings.

Calls {{QueryIterator qIter = exec(base, input) ;}} to execute the sub-op, 
using the external;y passed in {{QueryIterator}} (which may be the root - i.e. 
nothing). It now has the QueryIterator for the BGP and it filters that with 
{{QueryIterFilterExpr}}.

Looks like you want to do the same. Execute the sub-op. Try a few cases and 
stop in the debugger.

{noformat}
     protected QueryIterator execute(OpFilter opFilter, QueryIterator input) {
        ExprList exprs = opFilter.getExprs() ;

        Op base = opFilter.getSubOp() ;
        QueryIterator qIter = exec(base, input) ;

        for (Expr expr : exprs)
            qIter = new QueryIterFilterExpr(qIter, expr, execCxt) ;
        return qIter ;
    }
{noformat}

> Purpose of EvaluatorSimple and OpExecutor
> -----------------------------------------
>
>                 Key: JENA-2020
>                 URL: https://issues.apache.org/jira/browse/JENA-2020
>             Project: Apache Jena
>          Issue Type: Question
>          Components: ARQ
>            Reporter: Martin Pekár
>            Priority: Major
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I am in the midst of adding a new operator in the transformation of OpBGP. I 
> am now trying to implement the execution of the operator in the query plan, 
> but I am now slightly confused about the purpose of EvaluatorSimple used in 
> EvaluatorDispatch and OpExecutor. At the moment, it seems like they are doing 
> the same thing. The difference seems to be that OpExecutor stores the result 
> of applying the operator in a QueryIterator, whereas EvaluatorSimple stores 
> its result in a Table of bindings.
> Can someone give me an explanation of purposes of these two classes and how 
> they should be used?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to