Skip to content
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

Modify map_top_n to throw when nested nulls are present #11157

Closed

Conversation

DanielHunte
Copy link

Summary: Nested nulls present inhibit the orderbility of values. Currently, any check for nested null is bypassed when 'n' is greater than the size of the map. This chanhe removes the bypass. This will now match Presto's behavior.

Differential Revision: D63796842

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63796842

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Oct 2, 2024
Copy link

netlify bot commented Oct 2, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 271f719
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/670430626e04b9000806c922

DanielHunte pushed a commit to DanielHunte/velox that referenced this pull request Oct 7, 2024
…bator#11157)

Summary:

Nested nulls present inhibit the orderbility of values. Currently, any check for nested null is bypassed when 'n' is greater than the size of the map. This chanhe removes the bypass. This will now match Presto's behavior.

Differential Revision: D63796842
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63796842

DanielHunte pushed a commit to DanielHunte/velox that referenced this pull request Oct 7, 2024
…bator#11157)

Summary:

Nested nulls present inhibit the orderbility of values. Currently, any check for nested null is bypassed when 'n' is greater than the size of the map. This chanhe removes the bypass. This will now match Presto's behavior.

Differential Revision: D63796842
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63796842

Copy link
Contributor

@kevinwilfong kevinwilfong left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@@ -60,11 +60,6 @@ struct MapTopNFunction {
return;
}

if (n >= inputMap.size()) {
out.copy_from(inputMap);
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is we don't want to throw if the value itself is null, but only if it's a complex type that contains null. There's a way we could do this by accessing the key and element Vectors and iterating over them checking if they are null and if not, checking if they contain null. But assuming N is generally small the tradeoff between complexity and efficiency probably isn't worth it.

…bator#11157)

Summary:

Nested nulls present inhibit the orderbility of values. Currently, any check for nested null is bypassed when 'n' is greater than the size of the map. This chanhe removes the bypass. This will now match Presto's behavior.

Reviewed By: kevinwilfong

Differential Revision: D63796842
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63796842

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e014dab.

Copy link

Conbench analyzed the 1 benchmark run on commit e014dabd.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants