You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Eric Pugh <ep...@opensourceconnections.com> on 2009/05/22 20:43:59 UTC

DIH uses == instead of = in SQL

I am getting this error:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:  
You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to use  
near '=='1433'' at line 1
         at  
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

during a select for a specific institution:

org.apache.solr.handler.dataimport.DataImportHandlerException: Unable  
to execute query: select institution_id, name, acronym as i_acronym  
from institutions where institution_id=='1433' Processing Document # 1
         at org.apache.solr.handler.dataimport.JdbcDataSource 
$ResultSetIterator.<init>(JdbcDataSource.java:248)
         at  
org 
.apache 
.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:205)
         at  
org 
.apache 
.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:38)
         at  
org 
.apache 
.solr 
.handler 
.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
         at  
org 
.apache 
.solr 
.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java: 
71)

I just switched to using the paired deltaImportQuery and deltaQuery  
approach.   I am using the latest from trunk.  Any ideas?

Eric

-----------------------------------------------------
Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com
Free/Busy: http://tinyurl.com/eric-cal





Re: DIH uses == instead of = in SQL

Posted by Eric Pugh <ep...@opensourceconnections.com>.
Argh...   I learned a lesson (yet again!)...   I spent an hour setting  
up detailed logging, digging around in lots of DIH source, with no  
real luck finding the offending == versus =.   Mentioned my  
frustration to a colleague and he pointed out right where I had  
checked multiple times that I had typed in == versus = in my SQL  
statement!


Eric

On May 23, 2009, at 12:02 AM, Noble Paul നോബിള്‍  
नोब्ळ् wrote:

> are you using delta-import w/o a deltaImportQuery ? pls paste the
> relevant portion of data-config.xml
>
> On Sat, May 23, 2009 at 12:13 AM, Eric Pugh
> <ep...@opensourceconnections.com> wrote:
>> I am getting this error:
>>
>> Caused by:  
>> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
>> have an error in your SQL syntax; check the manual that corresponds  
>> to your
>> MySQL server version for the right syntax to use near '=='1433'' at  
>> line 1
>>        at  
>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>
>> during a select for a specific institution:
>>
>> org.apache.solr.handler.dataimport.DataImportHandlerException:  
>> Unable to
>> execute query: select institution_id, name, acronym as i_acronym from
>> institutions where institution_id=='1433' Processing Document # 1
>>        at
>> org.apache.solr.handler.dataimport.JdbcDataSource 
>> $ResultSetIterator.<init>(JdbcDataSource.java:248)
>>        at
>> org 
>> .apache 
>> .solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java: 
>> 205)
>>        at
>> org 
>> .apache 
>> .solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java: 
>> 38)
>>        at
>> org 
>> .apache 
>> .solr 
>> .handler 
>> .dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
>>        at
>> org 
>> .apache 
>> .solr 
>> .handler 
>> .dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:71)
>>
>> I just switched to using the paired deltaImportQuery and deltaQuery
>> approach.   I am using the latest from trunk.  Any ideas?
>>
>> Eric
>>
>> -----------------------------------------------------
>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>> http://www.opensourceconnections.com
>> Free/Busy: http://tinyurl.com/eric-cal
>>
>>
>>
>>
>>
>
>
>
> -- 
> -----------------------------------------------------
> Noble Paul | Principal Engineer| AOL | http://aol.com

-----------------------------------------------------
Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com
Free/Busy: http://tinyurl.com/eric-cal





Re: DIH uses == instead of = in SQL

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
are you using delta-import w/o a deltaImportQuery ? pls paste the
relevant portion of data-config.xml

On Sat, May 23, 2009 at 12:13 AM, Eric Pugh
<ep...@opensourceconnections.com> wrote:
> I am getting this error:
>
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
> have an error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near '=='1433'' at line 1
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>
> during a select for a specific institution:
>
> org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to
> execute query: select institution_id, name, acronym as i_acronym from
> institutions where institution_id=='1433' Processing Document # 1
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:248)
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:205)
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:38)
>        at
> org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
>        at
> org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:71)
>
> I just switched to using the paired deltaImportQuery and deltaQuery
> approach.   I am using the latest from trunk.  Any ideas?
>
> Eric
>
> -----------------------------------------------------
> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> http://www.opensourceconnections.com
> Free/Busy: http://tinyurl.com/eric-cal
>
>
>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: DIH uses == instead of = in SQL

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Eric,

WHERE institution_id=1433
  vs.
WHERE institution_id==1433

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Eric Pugh <ep...@opensourceconnections.com>
> To: solr-user@lucene.apache.org
> Sent: Friday, May 22, 2009 2:43:59 PM
> Subject: DIH uses == instead of = in SQL
> 
> I am getting this error:
> 
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have 
> an error in your SQL syntax; check the manual that corresponds to your MySQL 
> server version for the right syntax to use near '=='1433'' at line 1
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 
> during a select for a specific institution:
> 
> org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute 
> query: select institution_id, name, acronym as i_acronym from institutions where 
> institution_id=='1433' Processing Document # 1
>         at 
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.(JdbcDataSource.java:248)
>         at 
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:205)
>         at 
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:38)
>         at 
> org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
>         at 
> org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:71)
> 
> I just switched to using the paired deltaImportQuery and deltaQuery approach.  
> I am using the latest from trunk.  Any ideas?
> 
> Eric
> 
> -----------------------------------------------------
> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | 
> http://www.opensourceconnections.com
> Free/Busy: http://tinyurl.com/eric-cal