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

[DOP-21732] Fix Oracle reading with partitioning_mode=hash #319

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

dolfinus
Copy link
Member

@dolfinus dolfinus commented Nov 27, 2024

Change Summary

ORA_HASH(col, N) returns results from 0 to N including N (N+1 in total). Spark creates exactly N partitions, so last partition gets twice the data relative to other ones.

Fixed by calling ORA_HASH(col, N-1). Other JDBC sources don't have such an issue, as they use modulo which always returns values from 0 to N-1.

Related issue number

Checklist

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@dolfinus dolfinus marked this pull request as ready for review November 27, 2024 11:12
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.84%. Comparing base (8c39d1d) to head (e974d34).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #319      +/-   ##
===========================================
+ Coverage    91.67%   91.84%   +0.16%     
===========================================
  Files          225      225              
  Lines         9649     9649              
  Branches       987      987              
===========================================
+ Hits          8846     8862      +16     
+ Misses         608      593      -15     
+ Partials       195      194       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dolfinus dolfinus merged commit 83e6c80 into develop Nov 27, 2024
35 checks passed
@dolfinus dolfinus deleted the bugfix/DOP-21732 branch November 27, 2024 11:23
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.

2 participants