You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2014/10/19 12:29:33 UTC
[jira] [Created] (METAMODEL-87) ElasticSearch module does not
return Date objects for columns with DATE type
Kasper Sørensen created METAMODEL-87:
----------------------------------------
Summary: ElasticSearch module does not return Date objects for columns with DATE type
Key: METAMODEL-87
URL: https://issues.apache.org/jira/browse/METAMODEL-87
Project: Metamodel
Issue Type: Bug
Affects Versions: 4.3.0-incubating
Reporter: Kasper Sørensen
It seems that the ElasticSearch module returns Strings instead of java.util.Date objects when you query a DATE type field. That's IMO inconsistent and should be fixed.
To reproduce, add this to ElasticSearchDataContextTest:
{code}
@Test
public void testDateIsHandledAsDate() throws Exception {
Table table = dataContext.getDefaultSchema().getTableByName("tweet1");
Column column = table.getColumnByName("postDate");
ColumnType type = column.getType();
assertEquals(ColumnType.DATE, type);
DataSet dataSet = dataContext.query().from(table).select(column).execute();
while (dataSet.next()) {
Object value = dataSet.getRow().getValue(column);
assertTrue("Got class: " + value.getClass() + ", expected Date (or subclass)", value instanceof Date);
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)