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

Fix DictionaryArray::normalized_keys (#4788) #4789

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Sep 7, 2023

Which issue does this PR close?

Closes #4788

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 7, 2023
@@ -1005,7 +1005,7 @@ impl<K: ArrowDictionaryKeyType> AnyDictionaryArray for DictionaryArray<K> {
let v_len = self.values().len();
assert_ne!(v_len, 0);
let iter = self.keys().values().iter();
iter.map(|x| x.as_usize().min(v_len)).collect()
iter.map(|x| x.as_usize().min(v_len - 1)).collect()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pesky off by 1 error 😅

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I also verified this fixes my reproducer. Thank you @tustvold

@alamb alamb mentioned this pull request Sep 7, 2023
@tustvold tustvold merged commit 83390ed into apache:master Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic in cmp kernels with DictionaryArrays: Option::unwrap() on a None value'
2 participants