[
https://issues.apache.org/jira/browse/CALCITE-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18054999#comment-18054999
]
terran2010 edited comment on CALCITE-7404 at 1/29/26 1:51 AM:
--------------------------------------------------------------
[~mbudiu] Thank you for your response. Currently, I have found that both the
double quotes and the project field name are incorrect. Executing in MongoDB
will result in a syntax error.
The JIRA title has been modified.
was (Author: JIRAUSER306024):
[~mbudiu] Thank you for your response. Currently, I have found that both the
double quotes and the project field name are incorrect. Executing in MongoDB
will result in a syntax error
> Wrong Field Alias in MongoDB Aggregation Pipeline
> -------------------------------------------------
>
> 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)