shlok7296 edited a comment on pull request #2201:
URL: https://github.com/apache/calcite/pull/2201#issuecomment-705492603


   Terms query builders used for creating IN clause was already present in 
elasticsearch adapters but were not being used. We have raised a PR to build IN 
clause using terms query API against SqlStdOperatorTable.IN operator.
   
   Following code can be used to build IN query for a particular field - 
   
   RexBuilder rexb = new RexBuilder(new 
SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT));
   **rexb.makeCall(SqlStdOperatorTable.IN, builder.field("age"), 
rexb.makeLiteral("12"), rexb.makeLiteral("14"))**
   
   Above code will create following query - "{"terms":{"age":[12,14]}}"


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to