[ 
https://issues.apache.org/jira/browse/CALCITE-4232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shlok Srivastava updated CALCITE-4232:
--------------------------------------
    Description: 
IN clause is required in multiple queries to fetch  documents that contain more 
than one *exact terms* in a provided field.

SQL Query
{code:java}
name IN ("kimchy", "james"){code}
 RelNode for same-
{code:java}
rexb.makeCall(SqlStdOperatorTable.IN, builder.field("name"), 
rexb.makeLiteral("kimchy"), rexb.makeLiteral("james")){code}
 

Expected Elasticsearch Query - 
{code:java}
GET /_search
{"query": {"terms":
{"name": [ "kimchy", "james" ],"boost": 1.0}
}}
{code}

  *Problem* : Calcite for above RelNode throws _java.sql.SQLException : Error 
while preparing statement caused by UnsupportedOperationException_

*Solution*: Extend _IN SQLTableOperator_ support in elasticsearch adapters to 
build above expected Elasticsearch query.

 

  was:
IN clause is required in multiple queries to fetch  documents that contain more 
than one *exact terms* in a provided field.

SQL Query
{code:java}
name IN ("kimchy", "james"){code}
 

 

Query - 
 GET /_search{"query": {"terms":

{"name": [ "kimchy", "james" ],"boost": 1.0}

}}
  
 The above IN query is not supported in calcite elasticsearch adapters.

 


> Elasticsearch IN Query is not supported 
> ----------------------------------------
>
>                 Key: CALCITE-4232
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4232
>             Project: Calcite
>          Issue Type: Improvement
>          Components: elasticsearch-adapter
>            Reporter: Shlok Srivastava
>            Priority: Major
>              Labels: IN, calcite, elasticsearch, pull-request-available, query
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> IN clause is required in multiple queries to fetch  documents that contain 
> more than one *exact terms* in a provided field.
> SQL Query
> {code:java}
> name IN ("kimchy", "james"){code}
>  RelNode for same-
> {code:java}
> rexb.makeCall(SqlStdOperatorTable.IN, builder.field("name"), 
> rexb.makeLiteral("kimchy"), rexb.makeLiteral("james")){code}
>  
> Expected Elasticsearch Query - 
> {code:java}
> GET /_search
> {"query": {"terms":
> {"name": [ "kimchy", "james" ],"boost": 1.0}
> }}
> {code}
>   *Problem* : Calcite for above RelNode throws _java.sql.SQLException : Error 
> while preparing statement caused by UnsupportedOperationException_
> *Solution*: Extend _IN SQLTableOperator_ support in elasticsearch adapters to 
> build above expected Elasticsearch query.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to