-
Notifications
You must be signed in to change notification settings - Fork 867
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
Improve performance of DictionaryArray::try_new()
#1313
Comments
I can take it up. Could you assign it me? @alamb |
@jackwener I just opened a PR that does a small change to |
@jhorstmann Hello, I am newer for project, I am gradually trying to contribute. |
In I think a possible solution would be to extract the dictionary validation logic out of |
* improve `DictionaryArray::try_new()` #1313 * *: fix typo * *: add cheap validate and unit test * *: polish the error * Add safety note Co-authored-by: Andrew Lamb <[email protected]>
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
#1300 adds
DictionaryArray::try_new()
for creatingDictionaryArrays
from existing keys and dictionaries. However, as noted by @jhorstmann in #1300 (comment) this results in a double validation (that the keys and values are valid arrays, when we know they already are, in addition to validating that all the keys are valid indexes into the dictionary.Describe the solution you'd like
Minimize the checking in
DictionaryArray::try_new()
to only verify that all indexes are within the range of the dictionary, which is required for this to be a safe API.It also might be worth adding a
unsafe DictionaryArray::new_unchecked()
which builds the arrays from data the user asserts is valid.The text was updated successfully, but these errors were encountered: