Bug 780158 (SOA-2534)

Summary: Cannot run JCRSQL query with PATH thoruch ModeShape VDB
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: Documentation, EDSAssignee: Van Halbert <vhalbert>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.1.0.ER3   
Target Milestone: ---   
Target Release: 5.1.0.ER4   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2534
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-10 14:35:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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