Skip to content
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

New aggregates last minus first and high minus low #1742

Merged
merged 5 commits into from
Mar 6, 2022
Merged

New aggregates last minus first and high minus low #1742

merged 5 commits into from
Mar 6, 2022

Conversation

texodus
Copy link
Member

@texodus texodus commented Mar 6, 2022

This PR is a rebased, modified and tested version of #1739. The major changes:

  • The calculation Xn - X0 for these aggregate types used the double-promoting operator implementations for t_tscalar, (which is required by ExprTK), however the output column type for these aggregates was not promoted, leading to all 0/null values. This PR adds a new set of type-preserving methods add_typesafe and sub_typesafe that can be used safely with the new aggregates.
  • first_last_helper method was being called twice, when internally this method does a column-scan and calculates both values for each pass. This PR modifies the signature of first_last_helper to just return the tuple which can be decomposed by the caller, eliminating the extraneous iteration. This aggregate should really use the build_aggregate<> pattern like AGGTYPE_HIGH_WATER_MARK does currently..
  • Adds tests, fixed a typo, removed spurious .gitignore changes.

@finos-cla-bot
Copy link

finos-cla-bot bot commented Mar 6, 2022

Thank you for your contribution and Welcome to our Open Source Community!

To make sure your pull request is accepted successfully, we ask all our open source contributors to sign a Contributor License Agreement; having reviewed our contributor list, we require a CLA for the following people : (@shinny-yangyang).

In order to sign a CLA with FINOS, just submit a Pull Request with a simple change to this file (adding an empty line, or some random text at the bottom); this will trigger the EasyCLA bot, which will post a comment to the Pull Request stating whether all PR contributors are covered by FINOS CLA; if not covered, the bot will post instructions on how to sign the CLA.

Thanks once again for your contribution. Let us work with you to make the CLA process quick, easy and efficient so we can move forward with reviewing and accepting your pull request. Feel free to email [email protected] for any questions.

cc @maoo @TheJuanAndOnly99 @mcleo-d

@finos-cla-bot
Copy link

finos-cla-bot bot commented Mar 6, 2022

Thank you for your contribution and Welcome to our Open Source Community!

To make sure your pull request is accepted successfully, we ask all our open source contributors to sign a Contributor License Agreement; having reviewed our contributor list, we require a CLA for the following people : (@shinny-yangyang).

In order to sign a CLA with FINOS, just submit a Pull Request with a simple change to this file (adding an empty line, or some random text at the bottom); this will trigger the EasyCLA bot, which will post a comment to the Pull Request stating whether all PR contributors are covered by FINOS CLA; if not covered, the bot will post instructions on how to sign the CLA.

Thanks once again for your contribution. Let us work with you to make the CLA process quick, easy and efficient so we can move forward with reviewing and accepting your pull request. Feel free to email [email protected] for any questions.

cc @maoo @TheJuanAndOnly99 @mcleo-d

@texodus texodus changed the title Pr/1739 New aggregates last minus first and high minus low Mar 6, 2022
@texodus texodus merged commit 8cd9fa5 into master Mar 6, 2022
@texodus texodus deleted the pr/1739 branch March 6, 2022 22:29
@texodus texodus added the enhancement Feature requests or improvements label Mar 6, 2022
@shinny-yangyang
Copy link
Contributor

@texodus Thank you very much for your help. I still confused that is it necessary to add every aggtype to t_config::setup() (line 186 of config.cpp)? If so, why AGGTYPE_HIGH_WATERMARK and AGGTYPE_LOW_WATERMARK are not there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants