In fact there are fields that have a NULL value but they are already
taken care of in the SQL Query like: IF(field_name IS NULL, '',
field_name).
Also it's not just single rows that fail. It's all of them.
It does not seem to have anything to do with the data that's coming
from the database. If I omit the dataimporter.functions.escapeSql the
importer at least processes those rows that don't have any SQL meta
characters in them.

Sadly, I haven't had time to put together a test to verify that the
error really emerges from the DIH itself.
Do you have any experience with bugreporting or submitting patches
(just in case there really IS a bug)?


2012/10/27 Lance Norskog <goks...@gmail.com>:
> Which database rows cause the problem? The bug report talks about fields with 
> an empty string. Do your rows have empty string values?
>
> ----- Original Message -----
> | From: "Dominik Siebel" <m...@dsiebel.de>
> | To: solr-user@lucene.apache.org
> | Sent: Monday, October 22, 2012 3:15:29 AM
> | Subject: Re: DIH throws NullPointerException when using 
> dataimporter.functions.escapeSql with parent entities
> |
> | That's what I thought.
> | I'm just curious that nobody else seems to have this problem although
> | I found the exact same issue description in the issue tracker
> | (https://issues.apache.org/jira/browse/SOLR-2141) which goes back to
> | October 2010 and is flagged as "Resolved: Cannot Reproduce".
> |
> |
> | 2012/10/20 Lance Norskog <goks...@gmail.com>:
> | > If it worked before and does not work now, I don't think you are
> | > doing anything wrong :)
> | >
> | > Do you have a different version of your JDBC driver?
> | > Can you make a unit test with a minimal DIH script and schema?
> | > Or, scan through all of the JIRA issues against the DIH from your
> | > old Solr capture date.
> | >
> | >
> | > ----- Original Message -----
> | > | From: "Dominik Siebel" <m...@dsiebel.de>
> | > | To: solr-user@lucene.apache.org
> | > | Sent: Thursday, October 18, 2012 11:22:54 PM
> | > | Subject: Fwd: DIH throws NullPointerException when using
> | > | dataimporter.functions.escapeSql with parent entities
> | > |
> | > | Hi folks,
> | > |
> | > | I am currently migrating our Solr servers from a 4.0.0 nightly
> | > | build
> | > | (aprox. November 2011, which worked very well) to the newly
> | > | released
> | > | 4.0.0 and am running into some issues concerning the existing
> | > | DataImportHandler configuratiions. Maybe you have an idea where I
> | > | am
> | > | going wrong here.
> | > |
> | > | The following lines are a highly simplified excerpt from one of
> | > | the
> | > | problematic imports:
> | > |
> | > | <entity name="path" rootEntity="false" query="SELECT p.id,
> | > | IF(p.name
> | > | IS NULL, '', p.name) AS name FROM path p GROUP BY p.id">
> | > |
> | > |         <entity name="item" rootEntity="true" query="
> | > |                         SELECT
> | > |                                 i.*,
> | > |
> | > | CONVERT('${dataimporter.functions.escapeSql(path.name)}' USING
> | > | utf8) AS path_name
> | > |                         FROM items i
> | > |                         WHERE i.path_id = ${path.id}" />
> | > |
> | > | </entity>
> | > |
> | > | While this configuration worked without any problem for over half
> | > | a
> | > | year now, when upgrading to 4.0.0-BETA AND 4.0.0 the Import
> | > | throws
> | > | the
> | > | followeing Stacktrace and exits:
> | > |
> | > |  SEVERE: Exception while processing: path document :
> | > | null:org.apache.solr.handler.dataimport.DataImportHandlerException:
> | > | java.lang.NullPointerException
> | > |
> | > | which is caused by
> | > |
> | > | Caused by: java.lang.NullPointerException
> | > |         at
> | > |         
> org.apache.solr.handler.dataimport.EvaluatorBag$1.evaluate(EvaluatorBag.java:79)
> | > |
> | > | In other words: The EvaluatorBag doesn't seem to resolve the
> | > | given
> | > | path.name variable properly and returns null.
> | > |
> | > | Does anyone have any idea?
> | > | Appreciate your input!
> | > |
> | > | Regards
> | > | Dom
> | > |
> |

Reply via email to