-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix(sf|quadbin): QUADBIN_FROMLONGLAT not clamping latitudes and return some quadbin functions return NULL when NULL parameters #456
Conversation
This pull request has been linked to Shortcut Story #322342: QUADBIN_FROMLONGLAT not clamping latitudes successfully. |
I considered adding tests, but not sure if it's worth it as this maybe should be the default behaviour. |
The implementation is fine, and the result NULLs a big improvement. |
Perhaps we could add some clamping function, and even some "SAFE" function to cover different use cases: QUADBIN_FROMLONGLAT(-3.7038, 100, 4) -- ERROR: coordinates out of valid QUADBIN range
QUADBIN_FROMCLAMPLEDLONGLAT(-3.7038, 100, 4) -- 5206548197333270527
SAFE_QUADBIN_FROMLONGLAT(-3.7038, 100, 4) -- NULL |
Another detail: for clamping I see no problem with using an approximation to the limit value like 85.05, but for detecting the limit to return an error or NULL (if we implement the functions I propose), we should use the more exact value |
Regarding clamping is the solution implemented in other providers. But you are right maybe it's better to have two versions of this function. Or by default show an error to the user. What do you think @ernesmb? |
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.
I don't like clamping by default, but for consistency with the other providers we should apply it in SF as well. We'll discuss what to do next for all providers about this.
yeah I agree with @jgoizueta 's last comment. Let's apply the same we're doing with other providers and then later think about a possible better solution in all providers |
Description
Shortcut
The issue was only detected in this function. Also started returning NULL from some SQL functions that were returning non easy to debug errors for the user.
Type of change
Acceptance