You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Carsten Binnig <ca...@informatik.uni-heidelberg.de> on 2005/12/09 09:23:48 UTC

Reuse apache derby parser

Hi all,

is it possible to reuse the class 
"org.apache.derby.impl.sql.compile.ParserImpl" to transform an SQL query 
into a query tree (consisting of relational algebra operators).
I have seen the method "parseStatement" in class "ParserImpl" but i am 
not sure how i get an instance of this class? could anybody help me?

Best regards

Carsten

Re: Reuse apache derby parser

Posted by Jeffrey Lichtman <sw...@rcn.com>.
>is it possible to reuse the class 
>"org.apache.derby.impl.sql.compile.ParserImpl" to transform an SQL 
>query into a query tree (consisting of relational algebra operators).

The query tree produced by the parser is not in the form of 
relational algebra operators. At this point of processing in Derby, 
the nodes in the tree pretty much correspond to the syntactic 
elements of the original query, e.g. a SELECT statement would have a 
SelectNode with a select list, a FROM list and a qualification hanging off it.

The various processing steps before code generation convert the tree 
from its original form to something more closely resembling 
relational algebra. A lot of this happens in the optimizer, which 
changes the FROM list into a tree of JOIN nodes.


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/