amazon-archives / sql-jdbc

🔍 Open Distro for Elasticsearch JDBC Driver
Apache License 2.0
111 stars 49 forks source link

Error retrieving data from opendistro from Tableau #71

Closed kvkk closed 4 years ago

kvkk commented 4 years ago

Hi, I got opendistro-for-elasticsearch running locally on my laptop and loaded a simple table with four columns (id, latitude, longitude, shop_category) with shop_category being a text type field

Using tableau desktop and sql-jdbc driver, I was able to connect to the table and see the values in datasource view but when trying to create a worksheet with one of the columns, Tableau was throwing an error saying "There was a Java error".

Version Info: opendistro-for-elasticsearch: 1.6.0 sql-jdbc driver: opendistro-sql-jdbc-1.6.0.0-SNAPSHOT.jar java while running opendistro: openjdk12

Enabling logs at sql-jdbc, here is the error i see

[2020-04-15 19:45:54.918][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 >> "{"query":"SELECT `poi`.`brand` AS `brand`,\n  `poi`.`shop_category` AS `shop_category`\nFROM `poi`\nGROUP BY `poi`.`brand`,\n  `poi`.`shop_category`"}"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "HTTP/1.1 200 OK[\r][\n]"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "content-type: application/json; charset=UTF-8[\r][\n]"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "content-length: 187[\r][\n]"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "[\r][\n]"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "{[\n]"
[2020-04-15 19:45:55.359][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "  "error": {[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "    "reason": "There was internal problem at backend",[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "    "details": "invalid value operation on MISSING_VALUE",[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "    "type": "IllegalStateException"[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "  },[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "  "status": 500[\n]"
[2020-04-15 19:45:55.360][DEBUG][Thread-pool-3-thread-11][ApacheHttpTransport@a78fda6] http-outgoing-11 << "}"

In opendistro, i am seeing following error stack trace

Incoming request /_opendistro/_sql?format=jdbc: SELECT `poi`.`brand` AS `brand`,
  `poi`.`shop_category` AS `shop_category`
FROM `poi`
GROUP BY `poi`.`brand`,
  `poi`.`shop_category`
[2020-04-14T17:45:29,206][WARN ][c.a.o.s.e.f.PrettyFormatRestExecutor] [WMac5179515] Error happened in pretty formatter
java.lang.IllegalStateException: invalid value operation on MISSING_VALUE
    at com.amazon.opendistroforelasticsearch.sql.expression.model.ExprValue.value(ExprValue.java:23) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.BindingTupleResultSet.lambda$buildDataRows$1(BindingTupleResultSet.java:55) ~[?:?]
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_202]
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_202]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_202]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_202]
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_202]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_202]
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_202]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.BindingTupleResultSet.buildDataRows(BindingTupleResultSet.java:58) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.BindingTupleResultSet.<init>(BindingTupleResultSet.java:35) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.Protocol.loadResultSet(Protocol.java:78) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.Protocol.<init>(Protocol.java:65) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.PrettyFormatRestExecutor.execute(PrettyFormatRestExecutor.java:71) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.format.PrettyFormatRestExecutor.execute(PrettyFormatRestExecutor.java:47) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.AsyncRestExecutor.doExecuteWithTimeMeasured(AsyncRestExecutor.java:161) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.executor.AsyncRestExecutor.lambda$async$1(AsyncRestExecutor.java:121) ~[?:?]
    at com.amazon.opendistroforelasticsearch.sql.utils.LogUtils.lambda$withCurrentContext$0(LogUtils.java:72) ~[?:?]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.1.jar:7.6.1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
abbashus commented 4 years ago

Similar error message as Issue #401

dai-chen commented 4 years ago

Duplicated. Please see updates on issue #401.