Repository navigation
Move Postgres and SQL Server boundary handling into dialect adapters - #4645
Draft
dhwanilpatel wants to merge 1 commit into
Draft
dhwanilpatel wants to merge 1 commit into
dhwanilpatel wants to merge 1 commit into
Conversation
The uniform splitter is meant to be dialect-neutral, but special cases for Postgres uuid, bit and time 24:00:00 and SQL Server uniqueidentifier sat in shared reader code (BoundaryExtractorFactory and both statement setters), chosen only by column type name. Shared code imported the Postgres driver, and the UUID/GUID conversion was duplicated in both setters. Add two general UniformSplitterDBAdapter methods, with defaults that keep the MySQL and Oracle behaviour: - extractBinaryBoundary: how to read a binary boundary. - toQueryParameter: how to convert a boundary before binding it, used by RangePreparedStatementSetter and ColumnForBoundaryQueryPreparedStatementSetter. PostgreSQLDialectAdapter and SqlServerDialectAdapter take over their cases; the SQL Server byte order moves to SqlServerUniqueIdentifier. The setters take the adapter from RangeCountDoFn, RangeBoundaryDoFn and ReadWithUniformPartitions, which already hold it. Same boundaries, SQL and bound values for range reads and counts. The boundary query setter now also applies the Postgres bit and 24:00:00 conversions to parent ranges, as the range setter already did.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4645 +/- ##
============================================
+ Coverage 59.75% 66.42% +6.67%
+ Complexity 7926 2975 -4951
============================================
Files 1123 553 -570
Lines 72705 32563 -40142
Branches 8842 3764 -5078
============================================
- Hits 43447 21631 -21816
+ Misses 26362 9862 -16500
+ Partials 2896 1070 -1826
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The uniform splitter is meant to be dialect-neutral, but special cases for Postgres uuid, bit and time 24:00:00 and SQL Server uniqueidentifier sat in shared reader code (BoundaryExtractorFactory and both statement setters), chosen only by column type name. Shared code imported the Postgres driver, and the UUID/GUID conversion was duplicated in both setters.
Add two general UniformSplitterDBAdapter methods, with defaults that keep the MySQL and Oracle behaviour:
PostgreSQLDialectAdapter and SqlServerDialectAdapter take over their cases; the SQL Server byte order moves to SqlServerUniqueIdentifier. The setters take the adapter from RangeCountDoFn, RangeBoundaryDoFn and ReadWithUniformPartitions, which already hold it.
Same boundaries, SQL and bound values for range reads and counts. The boundary query setter now also applies the Postgres bit and 24:00:00 conversions to parent ranges, as the range setter already did.