-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding decimal support for min() and max() functions #9005
Adding decimal support for min() and max() functions #9005
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@minhancao The linux-adapters job failed. This is likely an alignment issue.
Please override this method:
|
@karteekmurthys I see this piece of code on line 99 of MinMaxAggregates.cpp, would this already have taken care of it?
|
Also, the accumulator internally uses a heap for sorting. This heap allocator must be an aligned allocator:
|
Hi @karteekmurthys, I have made the change that you have requested, please review when you can. thanks! |
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.
LGTM!
@minhancao : Looks good. Thanks for contributing ! |
@Yuhta would you please review this? |
Hi @Yuhta , can you review this PR when you can please? Thanks! |
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.
Can you run aggregation fuzzer on the PR for 20 min?
if (inputType->isLongDecimal()) { | ||
return std::make_unique<TNumericN<int128_t>>(resultType); | ||
} | ||
VELOX_NYI(); |
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.
VELOX_UNREACHABLE()
AlignedStlAllocator<T, sizeof(int128_t)>, | ||
StlAllocator<T>>; | ||
using Heap = std::vector<T, Allocator>; | ||
Heap heapValues; |
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.
nit: std::vector<T, Allocator> heapValues;
@Yuhta I have ran locally the velox aggregation fuzzer test:
output:
max() function:
output:
|
The branch seems messed up |
3918677
to
8abad48
Compare
@Yuhta Fixed the branch |
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…or#9005) Summary: Delivers facebookincubator#9004 This PR is for adding decimal support for min() and max() functions. presto-cli output: ``` presto:tpch> SELECT MIN(Col,2) FROM (VALUES cast(0.82 as decimal(5,4)), cast(2.333 as decimal(5,4)), cast(3.132 as decimal(5,4)), cast(4.344 as decimal(5,4))) AS X(Col); _col0 ------------------ [0.8200, 2.3330] (1 row) presto:tpch> SELECT MIN(Col,3) FROM (VALUES cast(0.82 as decimal(5,4)), cast(2.333 as decimal(5,4)), cast(3.132 as decimal(5,4)), cast(4.344 as decimal(5,4))) AS X(Col); _col0 -------------------------- [0.8200, 2.3330, 3.1320] (1 row) presto:tpch> SELECT MAX(Col,2) FROM (VALUES cast(0.82 as decimal(5,4)), cast(2.333 as decimal(5,4)), cast(3.132 as decimal(5,4)), cast(4.344 as decimal(5,4))) AS X(Col); _col0 ------------------ [4.3440, 3.1320] (1 row) presto:tpch> SELECT MAX(Col,3) FROM (VALUES cast(0.82 as decimal(5,4)), cast(2.333 as decimal(5,4)), cast(3.132 as decimal(5,4)), cast(4.344 as decimal(5,4))) AS X(Col); _col0 -------------------------- [4.3440, 3.1320, 2.3330] (1 row) ``` Pull Request resolved: facebookincubator#9005 Reviewed By: pedroerp Differential Revision: D56487562 Pulled By: Yuhta fbshipit-source-id: 283eb189a91840835784e565cd33fa713167d17d
Delivers #9004
This PR is for adding decimal support for min() and max() functions.
presto-cli output: