- 
                Notifications
    You must be signed in to change notification settings 
- Fork 40
For IBM Db2, change the data type for BLOB column to support storing up to 2GB #3000
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
Conversation
f2b485b    to
    8ef0b7b      
    Compare
  
    …" to "BLOB(2G)" [skip ci]
51f8972    to
    683f011      
    Compare
  
            
          
                core/src/main/java/com/scalar/db/common/checker/OperationChecker.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …e_mapping # Conflicts: # core/src/integration-test/java/com/scalar/db/storage/jdbc/ConsensusCommitAdminIntegrationTestWithJdbcDatabase.java # core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminCaseSensitivityIntegrationTest.java # core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminIntegrationTest.java # core/src/integration-test/java/com/scalar/db/storage/jdbc/SingleCrudOperationTransactionAdminIntegrationTestWithJdbcDatabase.java # core/src/integration-test/java/com/scalar/db/transaction/jdbc/JdbcTransactionAdminIntegrationTest.java # core/src/main/java/com/scalar/db/common/CoreError.java
| /gemini review | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively increases the BLOB size limit for Db2 by changing the data type to BLOB(2G). The associated limitations are handled well with new checks and error messages, and the integration tests are updated accordingly. I've identified a few areas in the unit tests where the changes to accommodate Db2's new limitations have unintentionally reduced test coverage for other databases. My review includes suggestions to conditionally adapt the tests based on the RDB engine to maintain this coverage.
        
          
                core/src/main/java/com/scalar/db/common/checker/OperationChecker.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left minor comments. Other than that, LGTM! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the IBM Db2 BLOB column data type mapping from VARBINARY(32672) to BLOB(2G) to support storing up to 2GB of data. Due to limitations of the Db2 BLOB data type, BLOB columns can no longer be used as primary keys, clustering keys, secondary indexes, or in ordering operations for cross-partition scans.
- Changes Db2 BLOB column mapping to support 2GB storage capacity
- Implements validation to prevent BLOB columns from being used as keys or indexes in Db2
- Updates integration tests to conditionally skip BLOB-related tests for Db2
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| RdbEngineDb2.java | Changes BLOB data type mapping and adds validation for unsupported BLOB operations | 
| JdbcOperationChecker.java | New operation checker that validates cross-partition scan ordering on BLOB columns | 
| CoreError.java | Adds new error messages for Db2 BLOB column restrictions | 
| JdbcDatabase.java | Updates to use the new JdbcOperationChecker | 
| OperationChecker.java | Makes checkOrderingsForScanAll method protected for extension | 
| Integration test files | Updates test methods to conditionally skip BLOB-related operations for Db2 | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                core/src/test/java/com/scalar/db/storage/jdbc/JdbcOperationCheckerTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …e_mapping # Conflicts: # core/src/main/java/com/scalar/db/common/CoreError.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
…up to 2GB (#3000) # Conflicts: # core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTestBase.java
Description
This changes the default mapping for Db2 BLOB column to a data type that allows storing up to 2GB. This changes addresses concerns that the original data type only allowed to store up 32KB which was deemed too restrictive.
The new Db2 data type used is named
BLOBand its maximum capacity is 2GB for Db2 LUW, which also coincides with the maximum capacity that the backing objectbyte[]of BlobColumn object can hold.Because of limitations of the Db2
BLOBdata type, ScalarDB BLOB column can no longer be used as :Related issues and/or PRs
Changes made
VARBINARY(32672)toBLOB(2G)Checklist
Additional notes (optional)
Release notes
When using Db2, the default data type used for ScalarDB BLOB column from Db2 is changed from
VARBINARY(32672)toBLOB(2G)to allow storing data up to 2GB. This brings new limitations that a BLOB column can no longer be used as partition key, clustering key, secondary index or as an ordering column in a cross-partitions scan, .i.e. ScanAll, operation.