Skip to content

Handle NULL output from our aggregates #379

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

Merged
merged 1 commit into from
Mar 31, 2022
Merged

Handle NULL output from our aggregates #379

merged 1 commit into from
Mar 31, 2022

Conversation

JLockerman
Copy link
Contributor

@JLockerman JLockerman commented Mar 30, 2022

pgx::Internal is inconsistent in that a NULL input to a function taking Internal works fine and results in an Internal containing None while returning an Internal containing None results in an error. This commit works around the issue by making our functions return an Option<Internal> if they can return a SQL NULL.

fixes #362

`pgx::Internal` is inconsistent in that a NULL input to a function
taking `Internal` works fine and results in an `Internal` containing
`None` while returning an Internal containing `None` results in an
error. This commit works around the issue by making our functions return
an `Option<Internal>` if they can return a SQL NULL.

fixes issue #362
@JLockerman JLockerman requested review from WireBaron and epgts March 30, 2022 18:33
Copy link
Contributor

@WireBaron WireBaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I would like to see a test for proper handling of timestamp, NULL in counter_agg, but that isn't necessary to close this issue.

@JLockerman
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 31, 2022

Build succeeded:

@bors bors bot merged commit 7d1266c into main Mar 31, 2022
@bors bors bot deleted the jl/hll-null-bugfix branch March 31, 2022 15:54
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.

Incorrect NULL handling in hyperloglog
3 participants