[daisy] Improvement:(DSY-283) Allow any sort of expression as arguments to LinksTo

netjunki ben at netjunki.org
Fri Feb 1 15:00:07 CST 2008


So I went ahead and took a stab at this, but now I have some new questions.


netjunki wrote:
> 
> 1. Modify the LinkToOrFrom function in the QueryParser to allow the first
> argument to be an expression (using subValueExpr() which can become a
> literal, identifier, or function... though I don't think this would deal
> with case of having an entire query as an argument to LinksTo.
> 

So I managed to get this part working.  I still need to convert the document
id to a DocId when it's a literal, but that's easy.  The problem I'm running
into now is related to a lack of understand of how the entire query parser
hooks to the rest of the system.

>From looking at the code it looks like the system works as follows:
1. A new query is recieved.
2. The parts of the query are parsed and evaluated, first at the hight level
of the select <fields> where <whereClause> level and then the parts of the
whereClause are evaluated.
3. At each step of the evaluation 3 (or 4 this is where I'm not clear and am
having a problem) things happend:
 a. the "prepare" method is called to resolve some of the parameters or call
the prepare methods on subexpressions
 d. "evaluate"  is called to allow an opportunity to work with
subexpressions and resolve those
 b. "generateSql" is called to create the SQL for any particular sub
expression
 c. "bindSql" is called to insert the actual values into the generated query
4. Once these steps are completed a complete SQL query is generated and then
executed by JDBC in the LocalQueryManager.

In the case of LinksToOrFrom there isn't an evaluate step... though I think
there might need to be to make this work (to evaluate the ContextDoc
function call since I'm going to need the ExprDocData to resolve the
document id... or am I misunderstanding something.).  I guess my question is
how could I poke around and see what happens during a normal call to
ContextDoc when it's just part of the where clause.

More specifically I'm trying to understand the code path for how the
whereClause is evaluated.  I was trying to trace it through PredicateExpr...
but I'm getting a little lost.

In the query:
select name where id != ContentDoc(id)

What's happening to resolve the part in bold?

Ben


-- 
View this message in context: http://www.nabble.com/Improvement%3A%28DSY-283%29-Allow-any-sort-of-expression-as-arguments-to-LinksTo-tp15172618p15234238.html
Sent from the Daisy - General mailing list archive at Nabble.com.



More information about the daisy mailing list