[
https://issues.jboss.org/browse/TEIID-5258?page=com.atlassian.jira.plugin...
]
dalex dalex updated TEIID-5258:
-------------------------------
Steps to Reproduce:
1. Add file resource adapter configuration in standalone-teiid.xml and put in the testdata
folder the failed.json file (see in attachment):
{code:xml}
<resource-adapter id="file">
<module slot="main"
id="org.jboss.teiid.resource-adapter.file"/>
<connection-definitions>
<connection-definition
class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory"
jndi-name="java:/files" enabled="true"
pool-name="files">
<config-property name="AllowParentPaths">
true
</config-property>
<config-property name="ParentDirectory">
C:/testdata
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Add translator "myFiles" in /deployments/test-vdb.xml:
{code:xml}
<translator name="myFiles" type="file"/>
{code}
3. Add "files" model in /deployments/test-vdb.xml:
{code:xml}
<model name="files">
<source name="files" translator-name="myFiles"
connection-jndi-name="java:/files"/>
</model>
{code}
4. Run the following script:
{code:sql}
Begin
with t As (
Select campaign_id, email_address, activity
From (
call files.getFiles(pathAndPattern => 'failed.json')
) f
Cross Join
XmlTable (
'/root/emails'
Passing JsonToXml('root', f.file)
Columns
campaign_id string,
list_id string,
list_is_active boolean,
email_id string,
email_address string,
activity xml
) x
Where activity Is Not Null
)
Select *
From t Cross Join XmlTable (
'/root/activity'
Passing XmlElement(root, t.activity)
Columns
action string,
"timestamp" timestamp,
url string,
ip string
) a;
End;
{code}
was:
1. Add file resource adapter configuration in standalone-teiid.xml and put in the testdata
folder the failed.json file (see in attachment):
{code:xml}
<resource-adapter id="file">
<module slot="main"
id="org.jboss.teiid.resource-adapter.file"/>
<connection-definitions>
<connection-definition
class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory"
jndi-name="java:/files" enabled="true"
pool-name="files">
<config-property name="AllowParentPaths">
true
</config-property>
<config-property name="ParentDirectory">
C:/testdata
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Add translator "myFiles" in /deployments/test-vdb.xml:
{code:xml}
<translator name="myFiles" type="file"/>
{code}
3. Add "files" model in /deployments/test-vdb.xml:
{code:xml}
<model name="files">
<source name="files" translator-name="myFiles"
connection-jndi-name="java:/files"/>
</model>
{code}
4. Run the following script:
{code:query}
Begin
with t As (
Select campaign_id, email_address, activity
From (
call files.getFiles(pathAndPattern => 'failed.json')
) f
Cross Join
XmlTable (
'/root/emails'
Passing JsonToXml('root', f.file)
Columns
campaign_id string,
list_id string,
list_is_active boolean,
email_id string,
email_address string,
activity xml
) x
Where activity Is Not Null
)
Select *
From t Cross Join XmlTable (
'/root/activity'
Passing XmlElement(root, t.activity)
Columns
action string,
"timestamp" timestamp,
url string,
ip string
) a;
End;
{code}
TEIID30151 Error building Source for context item
-------------------------------------------------
Key: TEIID-5258
URL:
https://issues.jboss.org/browse/TEIID-5258
Project: Teiid
Issue Type: Bug
Components: XML Connector
Affects Versions: 10.1
Environment: teiid-10.1.0 on WildFly Full 11.0.0.Final (WildFly Core
3.0.8.Final)
Reporter: dalex dalex
Assignee: Steven Hawkins
Attachments: failed.json
When running the following script:
{code:sql}
Begin
with t As (
Select campaign_id, email_address, activity
From (
call files.getFiles(pathAndPattern => 'failed.json')
) f
Cross Join
XmlTable (
'/root/emails'
Passing JsonToXml('root', f.file)
Columns
campaign_id string,
list_id string,
list_is_active boolean,
email_id string,
email_address string,
activity xml
) x
Where activity Is Not Null
)
Select *
From t Cross Join XmlTable (
'/root/activity'
Passing XmlElement(root, t.activity)
Columns
action string,
"timestamp" timestamp,
url string,
ip string
) a;
End;
{code}
teiid throws out the following error:
{code:noformat}
2018-02-13 17:55:47,054 WARN [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue7)
/okCCfP2/yjh TEIID30020 Processing exception for request /okCCfP2/yjh.0 'TEIID30151
Error building
Source for context item.'. Originally TeiidProcessingException
StaxToEventBridge.java:325.: org.teiid.core.TeiidProcessingException: TEIID30151 Error
building Source for context item
.
at
org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:163)
at
org.teiid.query.processor.relational.XMLTableNode$1.run(XMLTableNode.java:265)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: nu.xom.ParsingException
at nu.xom.Builder.build(Unknown Source)
at nu.xom.Builder.build(Unknown Source)
at
org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:157)
... 7 more
Caused by: java.lang.NullPointerException
at net.sf.saxon.evpull.StaxToEventBridge.getSystemId(StaxToEventBridge.java:325)
at net.sf.saxon.evpull.StaxToEventBridge.getSystemId(StaxToEventBridge.java:385)
at
net.sf.saxon.event.ContentHandlerProxyLocator.getSystemId(ContentHandlerProxyLocator.java:72)
at nu.xom.XOMHandler.startElement(Unknown Source)
at
net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:373)
at
org.teiid.query.xquery.saxon.ContentHandlerProxyReceiver.startContent(StreamingUtils.java:291)
at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
at
org.teiid.query.xquery.saxon.PathMapFilter.startContent(PathMapFilter.java:226)
at net.sf.saxon.event.TreeReceiver.startContent(TreeReceiver.java:220)
at
net.sf.saxon.evpull.EventIteratorToReceiver.copy(EventIteratorToReceiver.java:78)
at net.sf.saxon.event.Sender.sendPullEventSource(Sender.java:559)
at net.sf.saxon.event.Sender.send(Sender.java:132)
at net.sf.saxon.Configuration.buildDocument(Configuration.java:3361)
at net.sf.saxon.Configuration.buildDocument(Configuration.java:3303)
at org.teiid.query.xquery.saxon.SaxonReader.parse(StreamingUtils.java:175)
... 10 more
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)