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

Add test cases for aggregate arithmetic function "sum/min/max" having decimal argumets #88

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

anshuldata
Copy link
Contributor

@anshuldata anshuldata commented Aug 2, 2024

  • Enhanced BFT framework to compare decimal based on decimal number. This is done by loading decimal number from yaml as Decimal instead of float. To support it, introduced yaml tags "!decimal" and "!decimallist" which indicates presence of decimal type in values/result.
  • Added test cases for aggregate function "sum/min/max" with decimal arguments
  • Skipped adding avg for duckdb dialect since it is not supported (returns Double result instead of Decimal)
  • Skipped adding avg for snowflake dialect since returned type is not same as mentioned in Substrait spec.
  • Set precision based on Substrait (sum min, max) which is as follows
    Sum:
    Input DECIMAL<P, S> ==> Result: DECIMAL<38, S>
    Min:
    Input DECIMAL<P, S> ==> Result: DECIMAL<P, S>
    Max:
    Input DECIMAL<P, S> ==> Result: DECIMAL<P, S>**

@anshuldata
Copy link
Contributor Author

@richtia kindly review

@anshuldata anshuldata force-pushed the AggregateDecimalFuncs branch 2 times, most recently from 5cc3c8c to f36bdf0 Compare August 12, 2024 15:20
@anshuldata
Copy link
Contributor Author

@richtia updated PR to reflect precision based on substrait spec

@anshuldata anshuldata changed the title Add test cases for aggregate arithmetic function "sum/min/max/avg" having decimal argumets Add test cases for aggregate arithmetic function "sum/min/max" having decimal argumets Aug 13, 2024
@richtia
Copy link
Member

richtia commented Aug 22, 2024

can you pull in your docker compose fix PR and rerun these tests? #93

… check time

* Added custom tag "!decimal" and "!decimallist" and use them to load decimal value as decimal
Sum:
  Input DECIMAL<P, S> ==> Result: DECIMAL<38, S>
Min:
  Input DECIMAL<P, S> ==> Result: DECIMAL<P, S>
Max:
  Input DECIMAL<P, S> ==> Result: DECIMAL<P, S>
* Remove average test cases for now. Their return type doesn't seem to be conform to Substrait
* I will raise avg in a separate PR
@jacques-n
Copy link

I updated with a rebase on main.

@richtia richtia merged commit 90241dc into substrait-io:main Aug 22, 2024
6 checks passed
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.

3 participants