# Xpack/sql Does not appear to be able to handle "IN"

**URL:** <https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772>\
**Category:** Elasticsearch\
**Created:** [August 30, 2018, 7:49pm UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772 "2018-08-30T19:49:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lzukel](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lzukel](https://discuss.elastic.co/u/lzukel)\
**Post date:** [August 30, 2018, 7:49pm UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/1 "2018-08-30T19:49:09Z")

</div>

Example SQL -\>

> `SELECT visit.app.appVersion FROM index WHERE visit.app.appName IN ('appA', 'appB')`

returns

> ```
> {
> "error": {
> "root_cause": [
> {
> "type": "sql_illegal_argument_exception",
> "reason": "Don't know how to translate In In[visit.app.appName{f}#15620,[appA, appB]]"
> }
> ],
> "type": "sql_illegal_argument_exception",
> "reason": "Don't know how to translate In In[visit.app.appName{f}#15620,[appA, appB]]"
> },
> "status": 500
> }
> 
> ```

Seems like xpack/sql should know how to handle a terms query. Can anyone explain how to do this without breaking the original SQL query into multiples?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 30, 2018, 8:04pm UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/2 "2018-08-30T20:04:25Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/6.4/sql-syntax-select.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/sql-syntax-select.html) and associated pages show all the available options.

If you'd like something that's not listed then it would be great if you would raise a feature request.

---

<div class="post-metadata">

**Author:** ![lzukel](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lzukel](https://discuss.elastic.co/u/lzukel)\
**Post date:** [August 30, 2018, 8:23pm UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/3 "2018-08-30T20:23:03Z")

</div>

This seems like it should be pretty basic functionality

> WHERE visit.app.appName IN ('appA', 'appB')

should translate into something like:

> terms: {visit.app.appName: [appA, appB]}

I should NOT have to do something like:

> WHERE visit.app.appName = appA OR visit.app.appName = appB

I am fairly sure that something like this would have been (should have been) implemented, especially since the ES\_DSL supports checking for multiple terms in one field.  
I did look through the page you referred me to, I however do not see anything related to checking for one of many values inside of a field. This is part of the condition not necessarily part of the select. I do not see a page on supported condition operators. Thus the reason I asked the original question.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 30, 2018, 8:24pm UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/4 "2018-08-30T20:24:18Z")

</div>

[SQL Access | Elasticsearch Guide [6.4] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/xpack-sql.html) also mentions;

> This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

If you can create a feature request then it'll help us improve things! 🙂

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [August 31, 2018, 6:45am UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/5 "2018-08-31T06:45:01Z")

</div>

We are aware of this missing functionality and this feature has already been registered as a request [here](https://github.com/elastic/elasticsearch/issues/32955).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 28, 2018, 6:45am UTC](https://discuss.elastic.co/t/xpack-sql-does-not-appear-to-be-able-to-handle-in/146772/6 "2018-09-28T06:45:02Z")

</div>

Closed on September 28, 2018, 6:45am UTC

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