I recently upgraded elasticsearch to version 7.0.1 and dremio stopped working (Getting “Unexpected error ocurred”, “Invalid response”, etc. when trying to execute queries).
Apparently dremio is not yet compatible with ES 7.0.1. Are there any plans to make it compatible soon? Can’t wait!
We do not currently test against 7.x releases of Elasticsearch, only 6 and later versions of 5, but it’s not clear why there would be a breaking change with these newer versions. Do you have query profiles for any of the jobs that fail when querying against 7.0.1?
There is no specific query profile, it fails simply after adding the elasticsearch repository as a data source, then navigating to any of the indexes and clicking the “doc” item inside. Instead of getting the preview, I get these messages “Unexpected error ocurred”, “Invalid response”, etc.
{“queryId”:“2312a04e-c47b-b850-6998-5e1d3dc63b00”,“schema”:"[XXX, YYY-iptables-2019.04]",“queryText”:"select * f
rom ",“start”:1559060400428,“finish”:1559060400454,“outcome”:“FAILED”,“username”:“admin”}
Since there does not appear to be any updates to this issue, I looked through the stack trace and DremIO source code in Git, it appears that com.dremio.plugins.elastic.execution.ElasticsearchJsonReader.getScrollAndTotalSizeThenSeekToHits() on line 96 is expecting Elasticsearch’s response JSON to look like:
{
…
“hits”: {
“total”: 123,
“max_score”: 123,
…
}
whereas the response JSON from V7.4 looks something like:
com.dremio.plugins.elastic.execution.ElasticsearchJsonReader line 95 and 96 are as follows:
final JsonToken totalSizeToken = seekForward(ElasticsearchConstants.TOTAL_HITS);
Preconditions.checkState(totalSizeToken == JsonToken.VALUE_NUMBER_INT, “Invalid response”);
As such, it failed the check because the “total” attribute is no longer an int. I found the ES 7 release document referencing changes to hits.total:
Is there any way to fix it? I saw from https://github.com/atajti/dremio-oss that elasticsearch7 plugin change com.dremio.plugins.elastic.ElasticsearchConstants line 47 from String TOTAL_HITS = "total"; to String TOTAL_HITS = "total.value";. But then this only works for elasticsearch 7.