Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Jun 22, 2022

Which issue does this PR close?

Follow on to #2721 from @AssHero

Rationale for this change

If a DictionaryArray contains an index that can't be converted to usize (e.g. it is negative) it is invalid. Previously if this happened the error would be silently ignored.

What changes are included in this PR?

Change the code to panic if an invalid index was provided so any such error will be clearer

Are there any user-facing changes?

no

@github-actions github-actions bot added the core Core DataFusion crate label Jun 22, 2022
@alamb alamb marked this pull request as ready for review June 22, 2022 13:42

match values_index {
Ok(index) => (as_string_array(left_array.values()), Some(index)),
_ => (as_string_array(left_array.values()), None)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this ignores invalid data in DictionaryArrays (treats them as though they were NULLs) -- I think panic is better

@codecov-commenter
Copy link

Codecov Report

Merging #2767 (9973c69) into master (80e6e75) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2767      +/-   ##
==========================================
+ Coverage   84.93%   84.95%   +0.01%     
==========================================
  Files         271      271              
  Lines       48146    48140       -6     
==========================================
+ Hits        40892    40896       +4     
+ Misses       7254     7244      -10     
Impacted Files Coverage Δ
datafusion/core/src/physical_plan/hash_join.rs 94.68% <ø> (+0.57%) ⬆️
datafusion/common/src/scalar.rs 74.94% <0.00%> (+0.11%) ⬆️
datafusion/expr/src/logical_plan/plan.rs 74.11% <0.00%> (+0.39%) ⬆️
datafusion/expr/src/window_frame.rs 93.27% <0.00%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80e6e75...9973c69. Read the comment docs.

Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

LGTM

@xudong963
Copy link
Member

Thank you @alamb , let's merge it!

@xudong963 xudong963 merged commit e9423b8 into apache:master Jun 22, 2022
@alamb alamb deleted the alamb/hash_cleanup branch June 22, 2022 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants