-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
array_min / array_max behavior with NaN and NULL #21065
Comments
It's unfortunate but it's what it is :( We can't change without breaking existing stuff. Maybe we lump all these things together in a legacy flag so we can fix them in native. I would generally like ARRAY_MAX having similar behavior as MAX, but its not:
|
@kaikalur I see that min and max ignore NULL and NaN:
array_min, array_max return NaN if any element is NaN, NULL if no element is NaN, but there is a NULL element, min/max otherwise. |
@amitkdutta can someone help to assign this i want to work on this. |
It seems like the path forward here is to fix this and gate it by a flag. I agree with @kaikalur that it seems like consistency with min/max is the way to go. |
Thanks @tdcmeehan. Let's keep the legacy behavior by default. |
@amitkdutta Amit, ideally, we would avoid introducing legacy behavior in Velox, but it may not be possible due to existing workloads. Assuming this is not an option, let's keep the legacy behavior by default and add a flag to enable "new" behavior consistent with min and max aggregate functions. Going forward, let's make sure to document edge cases of functions to allow for consistency check when function is introduced for the first time. |
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Pull Request resolved: facebookincubator#7128 Based on prestodb/presto#21065 Differential Revision: D50386287 fbshipit-source-id: 404c7c885c54d3f70215811a1e2e7bc5874c50c9
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287
Summary: Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287
…o. (#7128) Summary: Pull Request resolved: #7128 Based on prestodb/presto#21065 Reviewed By: mbasmanova Differential Revision: D50386287 fbshipit-source-id: 15dd1594cb0976eb4f87b4f29531998a1c7466cb
In Presto, array_max or array_min both returns NAN if at least one element in the array is NAN.
Wondering if the behavior is correct or not.
CC: @kaikalur @prithvip @mbasmanova
The text was updated successfully, but these errors were encountered: