Skip to content

SQL: CLI: query fails to run against multi-value fields / arrays #67436

@bpintea

Description

@bpintea

The CLI client doesn't set the leniency parameter, so queries executed against multi-value fields fail.

sql> select * from kibana_sample_data_ecommerce limit 1;
Server error [Server encountered an error [Arrays (returned by [manufacturer]) are not supported]. [org.elasticsearch.xpack.ql.QlIllegalArgumentException: Arrays (returne
d by [manufacturer]) are not supported
        at org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor.unwrapMultiValue(AbstractFieldHitExtractor.java:164)
        at org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor.extractFromSource(AbstractFieldHitExtractor.java:257)
        at org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor.extract(AbstractFieldHitExtractor.java:145)
        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:116)
        at org.elasticsearch.xpack.sql.session.RowSet.forEachRow(RowSet.java:27)
        at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.createResponse(TransportSqlQueryAction.java:114)
        at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.createResponseWithSchema(TransportSqlQueryAction.java:109)
        at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.lambda$operation$0(TransportSqlQueryAction.java:84)
        at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:128)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions