[
https://issues.apache.org/jira/browse/CALCITE-7079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17986780#comment-17986780
]
Zhen Chen edited comment on CALCITE-7079 at 6/29/25 4:00 PM:
-------------------------------------------------------------
I wonder if it is possible to mix some other expressions, such as
{code:java}
xx and city = 'a'
xx and state <> 'a' and state <> 'b'
xx or city = 'a'
xx or (state <> 'a' and state <> 'b')
xx and (state <> 'a' or state <> 'b')
{code}
Where xx represents the expression city <> 'ABERDEEN' and city <> 'AIKEN'
in the jira description
was (Author: jensen):
I wonder if it is possible to mix some other expressions, such as
{code:java}
xx and city = 'a'
xx and state <> 'a' and state <> 'b'
xx or city = 'a'
xx or (state <> 'a' and state <> 'b')
{code}
Where xx represents the expression city <> 'ABERDEEN' and city <> 'AIKEN'
in the jira description
> Mongodb Adapter unable to translate multiple $ne condition conposed of "AND"
> ----------------------------------------------------------------------------
>
> Key: CALCITE-7079
> URL: https://issues.apache.org/jira/browse/CALCITE-7079
> Project: Calcite
> Issue Type: Bug
> Reporter: zhaowang
> Assignee: zhaowang
> Priority: Major
>
> Mongodb adapter translate more than one $ne condition error.
> run sql:
> {code:java}
> select city, state from zips where city <> 'ABERDEEN' and city <>
> 'AIKEN'{code}
> query plan:
> {code:java}
> {
> "$match": {
> "city": {
> "$ne": "AIKEN"
> }
> }
> }, {$project: {CITY: '$city', STATE: '$state'}}{code}
> The condition (city <> 'ABERDEEN') lost,actually, more than one $ne condition
> conpose of AND have to translate to $nin operation, such as:
> {code:java}
> {
> "$match": {
> "city": {
> "$nin": [
> "AIKEN",
> "ABERDEEN"
> ]
> }
> }
> }, {$project: {CITY: '$city', STATE: '$state'}} {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)