[
https://issues.apache.org/jira/browse/CALCITE-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055041#comment-18055041
]
Yu Xu commented on CALCITE-7404:
--------------------------------
I looked at the MongoDB documentation
(https://www.mongodb.com/zh-cn/docs/atlas/atlas-search/query-ref/) and did a
simple test on Docker. The syntax rules seem to be basically consistent with
your description. These double quotes should not be needed, but it would be
better if you could provide more documentation information.
> 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)