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

terran2010 updated CALCITE-7404:
--------------------------------
    Summary: Mongodb aggfunction not support condition filter  (was: Mongodb 
aggfuntion not support condition filter)

> Mongodb aggfunction not support condition filter
> ------------------------------------------------
>
>                 Key: CALCITE-7404
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7404
>             Project: Calcite
>          Issue Type: Bug
>          Components: mongodb-adapter
>    Affects Versions: 1.41.0
>            Reporter: terran2010
>            Priority: Major
>              Labels: pull-request-available
>
> The SQL:
> {code:java}
> select min(pop>5000) as pop_result from zips
> {code}
> The currently generated pipeline query statement
> {code:java}
> {
>   "$project": {
>     "$f0": {
>       "$gt": [
>         "$pop",
>         {
>           "$literal": 5000
>         }
>       ]
>     }
>   }
> }
> {
>   "$group": {
>     "_id": {},
>     "POP_RESULT": {
>       "$min": "$_0"
>     }
>   }
> } {code}
> The correct one should be
> {code:java}
> {
>   $project: {
>     _0: {
>       $gt: ['$pop', {
>         $literal: 5000
>       }]
>     }
>   }
> }
> {
>   $group: {
>     _id: {},
>     POP_RESULT: {
>       $min: '$_0'
>     }
>   }
> }{code}
> We should improve it



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

Reply via email to