Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas needs to handle arrays in elasticsearch raw documents better #56229

Closed
bhavyarm opened this issue Jan 28, 2020 · 1 comment · Fixed by #99549
Closed

Canvas needs to handle arrays in elasticsearch raw documents better #56229

bhavyarm opened this issue Jan 28, 2020 · 1 comment · Fixed by #99549
Labels
bug Fixes for quality problems that affect the customer experience Feature:Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:needs-research This issue requires some research before it can be worked on or estimated Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@bhavyarm
Copy link
Contributor

Kibana version: 7.6.0 BC2

Elasticsearch version: 7.6.0 BC2

Server OS version: darwin_x86_64

Browser version: chrome latest

Browser OS version: OS X

Original install method (e.g. download page, yum, from source, etc.): from staging

Describe the bug: If your elasticsearch raw document data source contains arrays - Canvas displays - " Whoops! Expression failed
Expression failed with the message:
[esdocs] > Unexpected error from Elasticsearch: [sql_illegal_argument_exception] Arrays (returned by [@tags]) are not supported"

This is not very helpful to novice user as the datasource is es raw documents and there is no obvious involvement of SQL here as user won't know that canvas uses sql to talk to es at the backend.

Steps to reproduce:

  1. Download & load logstash data to ES from build your own dashboard tutorial from docs - https://www.elastic.co/guide/en/kibana/current/tutorial-build-dashboard.html#tutorial-load-dataset and create logstash index pattern
  2. Start Kibana and ES and open Canvas app and start a new workpad
  3. Add an area chart element and change the data source to elasticsearch raw documents and pick logstash indexpattern
  4. Kibana displays '[esdocs] > Unexpected error from Elasticsearch: [sql_illegal_argument_exception] Arrays (returned by [@tags]) are not supported'

Expected behavior: Kibana needs to handle the datasets with arrays better. or display more helpful error message

Screenshots (if relevant):
Screen Shot 2020-01-28 at 3 38 49 PM

Provide logs and/or server output (if relevant): ES logs:

[2020-01-28T15:22:02,703][WARN ][r.suppressed             ] [Bhavyas-MBP.localdomain] path: /_sql, params: {format=json}
org.elasticsearch.xpack.sql.SqlIllegalArgumentException: Arrays (returned by [@tags]) are not supported
	at org.elasticsearch.xpack.sql.execution.search.extractor.FieldHitExtractor.unwrapMultiValue(FieldHitExtractor.java:173) ~[?:?]
	at org.elasticsearch.xpack.sql.execution.search.extractor.FieldHitExtractor.extractFromSource(FieldHitExtractor.java:288) ~[?:?]
	at org.elasticsearch.xpack.sql.execution.search.extractor.FieldHitExtractor.extract(FieldHitExtractor.java:153) ~[?:?]
	at org.elasticsearch.xpack.sql.execution.search.SearchHitRowSet.extractValue(SearchHitRowSet.java:128) ~[?:?]
	at org.elasticsearch.xpack.sql.execution.search.SearchHitRowSet.extractValue(SearchHitRowSet.java:31) ~[?:?]
	at org.elasticsearch.xpack.sql.execution.search.ResultRowSet.getColumn(ResultRowSet.java:37) ~[?:?]
	at org.elasticsearch.xpack.sql.session.AbstractRowSet.column(AbstractRowSet.java:18) ~[?:?]
	at org.elasticsearch.xpack.sql.session.RowView.forEachColumn(RowView.java:38) ~[?:?]
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.lambda$createResponse$2(TransportSqlQueryAction.java:111) ~[?:?]
	at org.elasticsearch.xpack.sql.session.RowSet.forEachRow(RowSet.java:27) ~[?:?]
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.createResponse(TransportSqlQueryAction.java:109) ~[?:?]
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.createResponseWithSchema(TransportSqlQueryAction.java:104) ~[?:?]
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.lambda$operation$0(TransportSqlQueryAction.java:80) ~[?:?]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.xpack.sql.execution.search.Querier$ScrollActionListener.lambda$handleResponse$1(Querier.java:486) [x-pack-sql-7.6.0.jar:7.6.0]
	at org.elasticsearch.xpack.sql.execution.search.ScrollCursor.handle(ScrollCursor.java:130) [x-pack-sql-7.6.0.jar:7.6.0]
	at org.elasticsearch.xpack.sql.execution.search.Querier$ScrollActionListener.handleResponse(Querier.java:485) [x-pack-sql-7.6.0.jar:7.6.0]
	at org.elasticsearch.xpack.sql.execution.search.Querier$BaseActionListener.onResponse(Querier.java:558) [x-pack-sql-7.6.0.jar:7.6.0]
	at org.elasticsearch.xpack.sql.execution.search.Querier$BaseActionListener.onResponse(Querier.java:532) [x-pack-sql-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:70) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:64) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.AbstractSearchAsyncAction.sendSearchResponse(AbstractSearchAsyncAction.java:539) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.ExpandSearchPhase.run(ExpandSearchPhase.java:117) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.AbstractSearchAsyncAction.executePhase(AbstractSearchAsyncAction.java:347) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:341) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.FetchSearchPhase.moveToNextPhase(FetchSearchPhase.java:216) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.FetchSearchPhase.lambda$innerRun$1(FetchSearchPhase.java:105) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.CountedCollector.countDown(CountedCollector.java:53) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.CountedCollector.onResult(CountedCollector.java:64) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.FetchSearchPhase$2.innerOnResponse(FetchSearchPhase.java:172) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.FetchSearchPhase$2.innerOnResponse(FetchSearchPhase.java:167) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.SearchActionListener.onResponse(SearchActionListener.java:45) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.SearchActionListener.onResponse(SearchActionListener.java:29) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.ActionListenerResponseHandler.handleResponse(ActionListenerResponseHandler.java:54) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleResponse(SearchTransportService.java:414) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1108) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processResponse(TransportService.java:1186) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1166) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:54) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.support.ChannelActionListener.onResponse(ChannelActionListener.java:47) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.support.ChannelActionListener.onResponse(ChannelActionListener.java:30) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:692) [elasticsearch-7.6.0.jar:7.6.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.6.0.jar:7.6.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

@bhavyarm bhavyarm added bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) labels Jan 28, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@clintandrewhall clintandrewhall added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:needs-research This issue requires some research before it can be worked on or estimated labels Mar 1, 2021
@cqliu1 cqliu1 assigned cqliu1 and unassigned cqliu1 Apr 22, 2021
@petrklapka petrklapka added the 1 label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:needs-research This issue requires some research before it can be worked on or estimated Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
6 participants