Bug 780158 (SOA-2534) - Cannot run JCRSQL query with PATH thoruch ModeShape VDB
Summary: Cannot run JCRSQL query with PATH thoruch ModeShape VDB
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2534
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, EDS
Version: 5.1.0.ER3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.1.0.ER4
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-03 09:12 UTC by Jiri Pechanec
Modified: 2010-11-10 14:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 14:35:26 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2534 0 Major Closed Cannot run JCRSQL query with PATH thoruch ModeShape VDB 2013-09-05 12:05:52 UTC

Description Jiri Pechanec 2010-11-03 09:12:11 UTC
project_key: SOA

If i directly query ModeShape datasource using
SELECT * FROM [nt:base] WHERE PATH([nt:base]) = '/queryNode' then I got proper result

If I use ModeShape VDB I cannot get any syntax running
    SELECT * FROM nt_base WHERE PATH([nt:base]) = '/queryNode' throws
         10:04:37,753 WARN  [PROCESSOR] Processing exception 'Lexical error: Lexical error at line 1, column 34.  Encountered: "[" (91), after : ""' for request C6VtYWzw9vqI.0.  Exception type org.teiid.api.exception.query.QueryParserException thrown from org.teiid.query.parser.QueryParser.handleTokenMgrError(QueryParser.java:209). Enable more detailed logging to see the entire stacktrace.
    SELECT * FROM nt_base WHERE PATH(nt_base) = '/queryNode' throws
         10:04:10,028 WARN  [PROCESSOR] Processing exception 'Element "nt_base" is not defined by any relevant group.' for request TpmZ4gS2CbJG.0.  Exception type org.teiid.api.exception.query.QueryResolverException thrown from org.teiid.query.resolver.util.ResolverVisitor.handleUnresolvedElement(ResolverVisitor.java:121). Enable more detailed logging to see the entire stacktrace.
             SELECT * FROM nt_base WHERE PATH(nt:base) = '/queryNode' throws
10:12:28,506 WARN  [PROCESSOR] Processing exception 'Lexical error: Lexical error at line 1, column 36.  Encountered: ":" (58), after : ""' for request i/qpHO7RMYbR.0.  Exception type org.teiid.api.exception.query.QueryParserException thrown from org.teiid.query.parser.QueryParser.handleTokenMgrError(QueryParser.java:209). Enable more detailed logging to see the entire stacktrace.

Comment 1 Van Halbert 2010-11-03 18:22:53 UTC
Link: Added: This issue is related to TEIID-1106


Comment 2 Van Halbert 2010-11-03 18:22:54 UTC
Due to the documentation is lagging in this regard, here is link has some information discussing how to query ModeShape thru Teiid.

Additional documentation regarding the pseudo columns can be found here:  http://docs.jboss.org/modeshape/2.3.0.Final/manuals/reference/html_single/reference-guide-en.html#jcr-sql2-pseudo-columns


Comment 3 Van Halbert 2010-11-03 18:25:45 UTC
The correct syntax for your query is:   SELECT * FROM nt_base WHERE  nt_base.jcr_path = '/queryNode'


The PATH() function is not usable when querying ModeShape thru Teiid, instead the pseudo column of jcr_path is used instead.  See the pseudo column documentation on the above comment.

Comment 4 Jiri Pechanec 2010-11-10 11:30:39 UTC
The statement suggested does not work as table nt_base does not exist but this statement works
SELECT * FROM 'nt:base' WHERE 'nt:base'.'jcr:path' = '/queryNode'

If this syntax is correct then please resolve the issue again

Comment 5 Van Halbert 2010-11-10 14:25:24 UTC
The syntax, thru Teiid, should look like:     select * from nt_base  where  nt_base.jcr_path = '/queryNode'



Comment 6 Jiri Pechanec 2010-11-10 14:35:14 UTC
Wrong datasource - my bad, sorry for this

Comment 7 Jiri Pechanec 2010-11-10 14:35:26 UTC
Verified in ER4


Note You need to log in before you can comment on or make changes to this bug.