lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pattabiraman, Meenakshisundaram" <Pattabiraman.Meenakshisunda...@aig.com>
Subject RE: XPathentity processor on CLOB field
Date Thu, 18 Jun 2015 11:50:45 GMT

This is the error cause reported.  I also see that it has been reported earlier (http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201103.mbox/%3CD0F0D26C-3AC0-4982-9E2B-09DC96937193@535consulting.com%3E)
but could not find a solution.


I am nesting the FieldReaderDataSource within the Entity definition that has a CLOB field.
With this it fails only after transforming the clob. 
If I do not nest, I get this error when the FieldReaderDataSource is initialized thus failing
even before the SQL is executed.
Either case, the error is happening at the same place. 


Caused by: java.sql.SQLException: SQL statement to execute cannot be empty or null
	at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
	at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
	at oracle.jdbc.driver.OracleSql.initialize(OracleSql.java:110)
	at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1761)
	at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1739)
	at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:298)
	at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:314)
	... 14 more






Pattabi Meenakshisundaram



-----Original Message-----
From: Pattabiraman, Meenakshisundaram [mailto:Pattabiraman.Meenakshisundaram@aig.com] 
Sent: Wednesday, June 17, 2015 9:33 PM
To: 'solr-user@lucene.apache.org'
Subject: XPathentity processor on CLOB field

My requirement is to read the XML from a CLOB field and parse it to get the entity.

The data config is as shown below. I am trying to map two fields 'event' and 'policyNumber'
for the entity 'catreport'.


<dataSource name="mbdev" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:orcl"
user="xyz" password="xyz"/> <document name="insight">
            <entity name="input" query="select * from test" logLevel="debug" datasource="mbdev"
transformer="ClobTransformer, script:toDate">
            <field column="LOAD_DATE" name="load_date" />

            <field column="RESPONSE_XML" name="RESPONSE_XML" clob="true" /> <dataSource
name="xmldata" type="FieldReaderDataSource"/>

            <entity name="catReport" dataSource="xmldata" dataField="input.RESPONSE_XML"
processor="XPathEntityProcessor"  forEach="/*:DecisionServiceRs"  rootEntity="true" logLevel="debug">
                        <field column="event" xpath="/dec:DecisionServiceRs/@event"/>


I am getting this error

....
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute
query: null Processing Document # 1
                at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:70)
                at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:321)
                at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:278)
                at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:53)
                at org.apache.solr.handler.dataimport.XPathEntityProcessor.initQuery(XPathEntityProcessor.java:283)
                at org.apache.solr.handler.dataimport.XPathEntityProcessor.fetchNextRow(XPathEntityProcessor.java:224)

I see that the Clob is getting converted to String correctly and the log has this entry where
xml is printed Exception while processing: input document : SolrInputDocument(fields: [RESPONSE_XML=<dec:Deci....


I do not know why the error is thrown at Jdbc when the Clob is converted to string and passed
to the FieldReader and do not know how to make this work.

Thanks
Pattabi

Mime
View raw message