On Mon, May 23, 2011 at 7:03 PM, stockii <[email protected]> wrote:
> yes. i put the &zeroDateTimeBehavior=convertToNull to my url like:
> url="jdbc:mysql://localhost/databaseName?zeroDateTimeBehavoir=convertToNull"
^^^^^^^^ I presume that
this is just a typo here, i.e., "Behavoir" instead of "Behavior".
[...]
> org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:373)
> Caused by: java.sql.SQLException: Value ' XXX
> 2011-01-07
> 0000-00-00
> 2011-01-21
> 0000-00-00 30 31 1 4 14 5 0 12 1 0 open 2011-01-07 15:10:47
> 10.1.0.121 2011-01-07 15:10:47 2011-01-07 15:10:47' can not be represented
> as java.sql.Date
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
> at com.mysql.jdbc.ResultSetRow.getDateFast(ResultSetRow.java:140)
> at com.mysql.jdbc.BufferRow.getDateFast(BufferRow.java:706)
> at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2174)
> at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2127)
> at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4956)
> at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5012)
[...]
Sorry, am on a bad network connection, and cannot test your particular
edge case of "0000-00-00" not converting properly with the specified
dateTimeFormat, but maybe you can have a workaround of a scriptTransformer
applied before the DateTimeTransformer that converts "0000-00-00" to
something more reasonable, like the beginning of the UNIX epoch, 1970-01-01.
Will check the "0000-00-00" issue tomorrow.
Regards,
Gora