[teiid-issues] [JBoss JIRA] Commented: (TEIID-1326) API request: rewrite query/command before it reaches the teiid planner

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Wed Apr 6 14:05:33 EDT 2011


    [ https://issues.jboss.org/browse/TEIID-1326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594095#comment-12594095 ] 

Steven Hawkins commented on TEIID-1326:
---------------------------------------

added the org.teiid.metadata.MetadataProvider interface in teiid api.  An instance can be injected onto the RuntimeEngineDeployer via the setMetadataProvider method.

The instance will be consulted to provide ViewDefinitions, which are simply the sql text and a scope so that it can be made specific to the user rather than applying to the whole vdb.  The instance will be consulted once per request for each view accessed.  This keeps the view definition consistent for planning purposes, such as determining union partitions, default updatablity, etc.

The view definition will have a basic validation check, but we are not currently looking for advanced issues such as potentially recursive definitions.

Some general tie will be needed in the cache eventing logic to purge prepared plans that have had their views modified.

> API request:  rewrite query/command before it reaches the teiid planner
> -----------------------------------------------------------------------
>
>                 Key: TEIID-1326
>                 URL: https://issues.jboss.org/browse/TEIID-1326
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Query Engine
>    Affects Versions: 7.1
>            Reporter: Mark Addleman
>            Assignee: Steven Hawkins
>             Fix For: 7.4
>
>
> I'd like an API to inspect and rewrite a user query/command before it reaches the Teiid planner. The use case is to rewrite the query/command to implement view-like capabilities.  For example:
> SELECT a,b,c FROM table1 AS t WHERE t.a='xyz'  would be rewritten as:
> SELECT a,b,c FROM (SELECT a,b,c FROM table2 UNION SELECT a,b,c FROM table3) AS t
> I imagine this API would be similar to the translator API:  it would receive a data structure representing the query/command and use a visitor to rewrite the query.  As a convenience, it would be nice to have something similar to the SQLConversionVisitor.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the teiid-issues mailing list