jhorcicka commented on a change in pull request #229: Upgrade to Elasticsearch
7.3.1
URL: https://github.com/apache/metamodel/pull/229#discussion_r331912466
##########
File path:
elasticsearch/rest/src/test/java/org/apache/metamodel/elasticsearch/rest/ElasticSearchRestDataContextIT.java
##########
@@ -119,22 +117,30 @@ private static void insertPeopleDocuments() throws
IOException {
indexOnePeopleDocument("male", 17, 2);
indexOnePeopleDocument("male", 18, 3);
indexOnePeopleDocument("male", 18, 4);
+
+ dataContext.refreshSchemas();
}
@Test
public void testSimpleQuery() throws Exception {
- assertEquals("[bulktype, peopletype, tweet1, tweet2]",
-
Arrays.toString(dataContext.getDefaultSchema().getTableNames().toArray()));
+ indexTweeterDocument(1);
- Table table = dataContext.getDefaultSchema().getTableByName("tweet1");
+ assertArrayEquals(new String[] { DEFAULT_TABLE_NAME }, dataContext
+ .getDefaultSchema()
+ .getTableNames()
+ .toArray());
+
+ final Table table =
dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME);
assertThat(table.getColumnNames(), containsInAnyOrder("_id",
"message", "postDate", "user"));
assertEquals(ColumnType.STRING,
table.getColumnByName("user").getType());
assertEquals(ColumnType.DATE,
table.getColumnByName("postDate").getType());
assertEquals(ColumnType.BIGINT,
table.getColumnByName("message").getType());
- try (DataSet ds =
dataContext.query().from(indexType1).select("user").and("message").execute()) {
+ dataContext.refreshSchemas();
+
+ try (DataSet ds =
dataContext.query().from(DEFAULT_TABLE_NAME).select("user").and("message").execute())
{
Review comment:
final?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services