Skip to content

Conversation

@cjj2010
Copy link

@cjj2010 cjj2010 commented Jan 28, 2026

@cjj2010 cjj2010 changed the title [CALCITE-7404] Mongodb aggfuntion not support condition filter [CALCITE-7404] Mongodb aggfunction not support condition filter Jan 28, 2026
@cjj2010 cjj2010 changed the title [CALCITE-7404] Mongodb aggfunction not support condition filter [CALCITE-7404] Mongo adapter aggfunction not support condition filter Jan 28, 2026
@cjj2010 cjj2010 changed the title [CALCITE-7404] Mongo adapter aggfunction not support condition filter [CALCITE-7404] Incorrect Field Alias in MongoDB $project Stage Jan 29, 2026
@cjj2010 cjj2010 changed the title [CALCITE-7404] Incorrect Field Alias in MongoDB $project Stage [CALCITE-7404] Incorrect Field Alias in MongoDB project Stage Jan 29, 2026
@xuzifu666
Copy link
Member

Jira mentioned some issues that need to be confirmed first.

* Incorrect Field Alias in MongoDB project Stage</a>. */
@Test void testAggFunctionMinFilter() {
assertModel(MODEL)
.query("select min(pop>5000) as pop_result from zips")
Copy link
Member

@xuzifu666 xuzifu666 Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more tests? For example, nested aliases, such as (a as b) as c.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more tests? For example, nested aliases, such as (a as b) as c.

I want to ask if it's similar "select (pop as popp) as pop_result from zips" ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, does this case meet expectations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is case meet expectations?

Errors will occur during the syntax parsing phase of SQL,
but: was "java.sql.SQLException: Error while executing SQL "select (pop as pop_a) as pop_result from zips": parse failed: Encountered "as" at line 1, column 13.
Was expecting one of:
"EXCEPT" ...
"FETCH" ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, and aliases don't support nesting, so this issue can be ignored.
I think can also add some general tests, such as those that don't include aggregate functions, like select pop as popp from zips.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, and aliases don't support nesting, so this issue can be ignored. I think can also add some general tests, such as those that don't include aggregate functions, like select pop as popp from zips.

Okay, I have added it

Copy link
Member

@xuzifu666 xuzifu666 Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to just put cases in a test method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants