-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ensure orderable types as input of array_sort
when it is used as a mitigation function
#6999
Comments
Proposal solution
bool ignoreMitigation = false;
if (mitigation.find("array_sort") != std::string::npos) {
ignoreMitigation = std::any_of(argTypes.cbegin(), argTypes.cend(),
[](const TypePtr& typePtr) {return !typePtr->isOrderable();});
|
@duanmeng Thank you for reporting this problem. Ignoring verification is undesirable. Using an internal version of array_sort that can sort any type might be better. |
@mbasmanova Got it, will add it in PR #6928, after its preceding PRs #6998 and #6950 merged. |
Close this issue as #6928 landed. Note that this change reduces coverage in the AggregationFuzzer. Before this change, the Fuzzer was able to verify results against DuckDB (since it supports array_sort function), but now it cannot. We are going to face same problem with using Presto as the reference query runner. A solution could be to change the Fuzzer to apply post-aggregation projections using Velox only (once to Velox results, once to results from reference DB), then compare. This is a follow-up though. |
Description
In
AggregationFuzzerTest
order-dependent functions may depend onarray_sort
to transform/sort the results to a value that can be verified. Thearray_sort
is supposed only to support orderable input types (see #6928), and the current fuzzer framework could only respect the function signature constraints when it is a 'test' function. In this scenario, thearray_sort
is not a 'test' function but a verify helper function, so its input would be the result of the actual test function, which may be an unorderable type (e.g.MapType
).https://github.com/facebookincubator/velox/blob/main/velox/exec/tests/AggregationFuzzerTest.cpp#L64-L94
https://github.com/facebookincubator/velox/blob/main/velox/exec/tests/utils/AggregationFuzzer.cpp#L771-L789
cc @mbasmanova @xiaoxmeng
The text was updated successfully, but these errors were encountered: