# Elasticsearch with trino not working for a specific field present in an index

**URL:** <https://discuss.elastic.co/t/elasticsearch-with-trino-not-working-for-a-specific-field-present-in-an-index/373684>\
**Category:** Elasticsearch\
**Created:** [January 26, 2025, 3:41pm UTC](https://discuss.elastic.co/t/elasticsearch-with-trino-not-working-for-a-specific-field-present-in-an-index/373684 "2025-01-26T15:41:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karan\_Rawat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karan_rawat/32/136184_2.png) [@Karan\_Rawat](https://discuss.elastic.co/u/Karan_Rawat)\
**Post date:** [January 26, 2025, 3:41pm UTC](https://discuss.elastic.co/t/elasticsearch-with-trino-not-working-for-a-specific-field-present-in-an-index/373684/1 "2025-01-26T15:41:59Z")

</div>

just using trino on my elasticsearch ,ran a query on my accounts index  
`SELECT * FROM elasticsearch."default".accounts WHERE id = 24862540;`  
which resulted in an error  
`SQL Error [58]: Query failed (#20250126_153854_00143_ta2zm): Expected object for field 'customFields' of type ROW: [] [ArrayList]`  
this was the datatype of "customFields" -\> row(customField row(id bigint))  
and the index on elasticsearch was

```auto
  "customFields": {
          "properties": {
            "customField": {
              "properties": {
                "id": {
                  "type": "long"
                }
              }
            },
            "value": {
              "type": "search_as_you_type",
              "doc_values": false,
              "max_shingle_size": 3
            }
          }
        }

```

how should i typecast to get the proper result ?
