lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-4978) Time is stripped from datetime column when imported into Solr date field
Date Mon, 08 Jul 2013 11:31:50 GMT

    [ https://issues.apache.org/jira/browse/SOLR-4978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13701949#comment-13701949
] 

ASF subversion and git services commented on SOLR-4978:
-------------------------------------------------------

Commit 1500666 from shalin@apache.org
[ https://svn.apache.org/r1500666 ]

SOLR-4978: Time is stripped from datetime column when imported into Solr date field if convertType=true
                
> Time is stripped from datetime column when imported into Solr date field
> ------------------------------------------------------------------------
>
>                 Key: SOLR-4978
>                 URL: https://issues.apache.org/jira/browse/SOLR-4978
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>            Reporter: Bill Au
>
> I discovered that all dates I imported into a Solr date field from a MySQL datetime column
have the time stripped (ie time portion is always 00:00:00).
> After double checking my DIH config and trying different things, I decided to take a
look at the DIH code.
> When I looked at the source code of DIH JdbcDataSource class, I discovered that it is
using java.sql.ResultSet and its getDate() method to handle date field. The getDate() method
returns java.sql.Date. The java api doc for java.sql.Date
> http://docs.oracle.com/javase/6/docs/api/java/sql/Date.html
> states that:
> "To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date
instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to
zero in the particular time zone with which the instance is associated."
> I am so surprise at my finding that I think I may not be right.  What am I doing wrong
here?  This is such a big hole in DIH, how could it be possible that no one has noticed this
until now?
> Has anyone successfully imported a datetime column into a Solr date field using DIH?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message