How to bypass Array error in Canvas?

Elasticsearch: 7.6.2
Kibana: 7.6.2

Hi. I'm fairly new with using the Elastic Stack. Trying to explore both Kibana and Canvas to decide which to use for our dashboards. We are currently leaning towards Canvas for its capability to be posted on a Web App. Currently on a roadblock with this error:

[esdocs] > Unexpected error from Elasticsearch: [sql_illegal_argument_exception] Arrays (returned by [group_names]) are not supported

We don't want to change the data format from Array to another one. Is there anyway to bypass this? We don't need to show the extent of the Array on the dashboard, just one data from it will do. Thanks!

There is an open issue, SQL array handling is inconsistent · Issue #33204 · elastic/elasticsearch · GitHub, for better support of arrays in Elasticsearch SQL. Please see details in that PR for alternative data structures as a work around.

We don't want to change the data format from Array to another one. Is there anyway to bypass this? We don't need to show the extent of the Array on the dashboard, just one data from it will do.

If you don't want to change your data structure and are only interested in the first item in the array, then you could create a scripted field that just returns the first value from the array

Thank you for the reply.

Please correct me if I'm wrong, Canvas doesn't support scripted fields, right? We currently have a scripted field for time difference and I remember not being able to use it on Canvas.

It looks like canvas does not support scripted fields. Maybe you comment on https://github.com/elastic/kibana/issues/26846, describing your usecase for how scripted fields would help work around this limitation.

Thanks.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.