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

Yu Xu commented on CALCITE-7673:
--------------------------------

Apologies, I may have phrased that unclearly.

My initial plan was indeed to "push down" execution to the MongoDB engine—for 
instance, mapping `LIKE` to the `$regex` expression and `=` to `$eq`. Can refer 
to this documentation for the corresponding operations: 
[https://www.mongodb.com/docs/manual/reference/operator/query/regex/#mongodb-query-op.-regex]

This is similar to how we currently support other operators in the MongoDB 
adapter—such as the support for `LESS_THAN` and `IS_NULL` in `MongoFilter`.

> MongoDB Adapter can not support LIKE operator
> ---------------------------------------------
>
>                 Key: CALCITE-7673
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7673
>             Project: Calcite
>          Issue Type: Improvement
>          Components: mongodb-adapter
>    Affects Versions: 1.42.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>             Fix For: 1.43.0
>
>
> Currently MongoDB Adapter not support LIKE operator.
> sql:
> {code:java}
> select state, city from zips where state like 'A%' order by state;{code}
> would error out:
> {code:java}
> java.lang.AssertionError: cannot translate LIKE(CAST(ITEM($0, 
> 'city')):VARCHAR(20), 'A%')  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to