[
https://issues.apache.org/jira/browse/CALCITE-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055005#comment-18055005
]
Yu Xu commented on CALCITE-7404:
--------------------------------
Want to know the version of MongoDB you are testing, and whether the behavior
is consistent across different versions.
> Incorrect Field Alias in MongoDB $project Stage
> -----------------------------------------------
>
> 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)