-
Couldn't load subscription status.
- Fork 176
Make basic aggregation working (part 1) #3318
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
Make basic aggregation working (part 1) #3318
Conversation
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
|
Ping @qianheng-aws. We may merge PR to dev branch ASAP to unblock peer's tasks. cc @penghuo @dai-chen , you can review and comment regardless of whether PR is merged or not. We will address them in followups. |
| return typeFactory.createSqlType(SqlTypeName.DOUBLE); | ||
|
|
||
| default: | ||
| return super.deriveSumType(typeFactory, argumentType); |
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.
why default to deriveSumType instead of deriveAvgAggType?
| case INTEGER: | ||
| case BIGINT: | ||
| return typeFactory.createSqlType(SqlTypeName.DOUBLE); |
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 it a bug in Calcite? if the argumentType is INTEGER, deriveAvgAggType is INTEGER?
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 so, for example table1:
| id |
|---|
| 1 |
| 2 |
| 3 |
| 4 |
select avg(id) from table1 returns 2 instead of 2.5.
Not sure it is a bug or by designed. From semantic purpose, query avg on an id column is semantic wrong. The column which could be applied avg should be designed as decimal number. Will open a Calcite issue for checking.
e7188da
into
opensearch-project:feature/calcite-engine
* Make basic aggregation working (partial) Signed-off-by: Lantao Jin <ltjin@amazon.com> * add a settings to enable calcite Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more UTs Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com>
* Make basic aggregation working (partial) Signed-off-by: Lantao Jin <ltjin@amazon.com> * add a settings to enable calcite Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more UTs Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com> Signed-off-by: xinyual <xinyual@amazon.com>
Description
This PR includes 5 changes:
OpenSearchTypeSystem(partial code) to address the type mismatch issue in AggCalcitePPL*ITand unit testCalcitePPL*Testfor each command.OpenSearchIndexEnumeratorRelated Issues
Partially Resolves #3308
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.