You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2022/03/17 09:16:00 UTC

[jira] [Commented] (CALCITE-5049) Error when executing join on Elasticsearch Adapter

    [ https://issues.apache.org/jira/browse/CALCITE-5049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17508074#comment-17508074 ] 

Stamatis Zampetakis commented on CALCITE-5049:
----------------------------------------------

The error seems to be related with the type of the field that you are joining on. Have you tried performing a join with other types of fields e.g., numerics? 

> Error when executing join on Elasticsearch Adapter
> --------------------------------------------------
>
>                 Key: CALCITE-5049
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5049
>             Project: Calcite
>          Issue Type: Bug
>          Components: elasticsearch-adapter
>    Affects Versions: 1.29.0
>            Reporter: Yamaga fow
>            Priority: Critical
>
> Hi
> I am trying to make a SQL join query over Elasticsearch but it's returning this error:
>  
> SQL query:
> {code:java}
> SELECT * FROM "jp_art_desc" a inner join "jp_art_coef" b ON a.ID_ART = b.ID_ART ; {code}
> Error:
> {code:java}
> SQL Error: Error while executing SQL "SELECT * FROM "jp_art_desc" a inner  join "jp_art_coef" b ON a.ID_ART = b.ID_ART ": org.elasticsearch.client.ResponseException: method [POST], host [http://***], URI [/jp_art_desc/_search?scroll=1m], status line [HTTP/1.1 400 Bad Request]
> {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [ID_ART] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"jp_art_desc","node":"rcltVuOcTJOLJxnuGelrOA","reason":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [ID_ART] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}}],"caused_by":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [ID_ART] in order to load field data by uninverting the inverted index. Note that this can use significant memory.","caused_by":{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [ID_ART] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}}},"status":400} {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)