-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-7404] Incorrect Field Alias in MongoDB project Stage #4774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" ?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" ...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
jira: https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-7404