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

ASF GitHub Bot commented on METAMODEL-172:
------------------------------------------

GitHub user ardlema opened a pull request:

    https://github.com/apache/metamodel/pull/43

    METAMODEL-172: Adding Date parsing to ES module

    When working with ElasticSearch indexes that contains Date types the API is 
returning Strings instead of proper Date objects. We found out this problem 
querying an index with a time-zone format field.
    
    Changes made in this PR:
    
       - Added time-zone format dates support in the TimeComparator class
       - Added a string to date direct conversion through the TimeComparator 
class in the ElasticSearchUtils class that will convert the string from ES into 
a proper Date (when the format will be supported by Metamodel)
       - Added a new unit test for the ElasticSearchUtils class

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ardlema/metamodel METAMODEL-172

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metamodel/pull/43.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #43
    
----
commit 8ab1394b1fbb0bd144ccd9a2b8df959b7c82f729
Author: Alberto Rodriguez <[email protected]>
Date:   2015-08-24T07:07:32Z

    Added time zone pattern

commit c12cb11e8d1b11de64e2657f2e444b4a47f037e5
Author: Alberto Rodriguez <[email protected]>
Date:   2015-08-24T07:08:00Z

    Convert dates column types to proper Date object

----


> ElasticSearch Date types should be converted properly
> -----------------------------------------------------
>
>                 Key: METAMODEL-172
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-172
>             Project: Apache MetaModel
>          Issue Type: Bug
>            Reporter: Alberto
>            Priority: Critical
>
> When working with ElasticSearch indexes that contains Date types the API is 
> returning Strings instead of proper Date object.
> We should add some logic inside the ElasticSearchUtils createRow() method to 
> convert these strings to java.Date objects. As we are not doing this 
> conversion so far the TimeComparator convertFromString method is not able to 
> parse the string value as a Date, the method returns null and then the 
> FormatHelper class is throwing an IllegalStateException.
> This is a bit tricky though because the number of date formats supported by 
> ElasticSearch is quite big  to think about creating a SimpleDateFormat to 
> support every single case: 
> https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to