You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Yu Xu (Jira)" <ji...@apache.org> on 2026/07/28 01:52:00 UTC
[jira] [Comment Edited] (CALCITE-7673) MongoDB Adapter can not support LIKE operator
[ https://issues.apache.org/jira/browse/CALCITE-7673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18099594#comment-18099594 ]
Yu Xu edited comment on CALCITE-7673 at 7/28/26 1:51 AM:
---------------------------------------------------------
[~julianhyde] I understand that this doesn't need to be pushed down to MongoDB. The implementation of the `LIKE` operator primarily takes place within the MongoDB adapter(convert SQL to MongoDB query syntax)—similar to how the Elasticsearch adapter handles `LIKE`. The syntax used within the adapter remains entirely based on Calcite's SQL style (e.g., `select state, city from zips where state like 'A%' order by state;`).
Currently, the corresponding `LIKE` interface throws an "unsupported" exception by default; as I see it, simply implementing the interface should suffice. I also used this method to tentatively develop this ability, and it seems to work.
was (Author: JIRAUSER307770):
[~julianhyde] I understand that this doesn't need to be pushed down to MongoDB. The implementation of the `LIKE` operator primarily takes place within the MongoDB adapter—similar to how the Elasticsearch adapter handles `LIKE`. The syntax used within the adapter remains entirely based on Calcite's SQL style (e.g., `select state, city from zips where state like 'A%' order by state;`).
Currently, the corresponding `LIKE` interface throws an "unsupported" exception by default; as I see it, simply implementing the interface should suffice. I also used this method to tentatively develop this ability, and it seems to work.
> 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)