Skip to content

Conversation

@Torch3333
Copy link
Contributor

@Torch3333 Torch3333 commented Oct 17, 2025

Description

This changes the default mapping for Oracle BLOB column to a data type that allows storing up to 2GB. The former data type RAW(2000) allowed a maximum data size of 2000 bytes. This changes addresses a similar concerns regarding Db2 that the original data type only allowed to store up 2KB which was deemed too restrictive.

The new Oracle data type used is named BLOB and its maximum capacity is 2GB which also coincides with the maximum capacity that the backing object byte[] of BlobColumn object can hold.

Because of limitations of the Oracle BLOB data type, ScalarDB BLOB column can no longer be used as :

  • primary key
  • clustering key
  • secondary index
  • a column of a where condition in a Get or Scan operation
  • an ordering column in a cross-partition scan

Related issues and/or PRs

Changes made

  • Changes the default mapping for ScalarDB BLOB column in Oracle from RAW(2000) to BLOB
  • Disable some integration tests that can no longer be run on a BLOB column because of the limitations mentioned above
  • Added an integration test for putting and reading a 100MB BLOB for Oracle and Db2.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

Provide any additional information or notes that may be relevant to the reviewers or stakeholders.

Release notes

When using Oracle, the default data type used for ScalarDB BLOB column from Oracle is changed from RAW(2000) to BLOB to allow storing data up to 2GB. This introduces new limitations: a BLOB column can no longer be used as a partition key, clustering key, secondary index, or a condition in a Get or Scan operation.

@Torch3333 Torch3333 self-assigned this Oct 17, 2025
@Torch3333
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 changes the default data type for BLOB columns in Oracle from RAW(2000) to BLOB to support storing up to 2GB of data. This change aligns Oracle's BLOB handling with that of Db2 and addresses previous concerns about storage limitations. As a result of using the native BLOB type, several limitations are introduced for Oracle: BLOB columns can no longer be used as primary keys, clustering keys, secondary indexes, or in conditions and orderings for cross-partition scans. The changes include updating the RdbEngine for Oracle, adding new error codes, and modifying integration tests to respect these new limitations. A specific workaround for handling large BLOBs (>32KB) in Oracle has also been implemented. The changes are thorough and well-tested. I have one minor suggestion to improve a comment's clarity.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Torch3333 Torch3333 marked this pull request as ready for review October 20, 2025 00:27
Copilot AI review requested due to automatic review settings October 20, 2025 00:27
Copy link
Contributor

Copilot AI left a 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 updates the Oracle JDBC adapter to change the default data type mapping for BLOB columns from RAW(2000) to native Oracle BLOB type, which can store up to 2GB instead of just 2KB. This addresses the restrictive storage limitation of the previous mapping.

  • Changes Oracle BLOB column mapping from RAW(2000) to BLOB for increased storage capacity
  • Introduces restrictions preventing BLOB columns from being used as keys, secondary indexes, or in cross-partition scan conditions/ordering
  • Updates integration tests to disable BLOB-related functionality where Oracle no longer supports it

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
RdbEngineOracle.java Implements new BLOB data type mapping and validation methods for Oracle limitations
JdbcOperationChecker.java Adds cross-partition scan condition checking for BLOB columns
Multiple test files Updates integration tests to handle Oracle BLOB limitations and adds new BLOB size testing
CoreError.java Adds error messages for Oracle BLOB limitations
Multiple admin/storage test files Updates to disable BLOB column features where Oracle doesn't support them

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Torch3333 Torch3333 requested review from a team, brfrn169, feeblefakie and komamitsu and removed request for a team October 22, 2025 01:49
Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM other than what Toshi pointed out.
Thank you!

# Conflicts:
#	core/src/main/java/com/scalar/db/common/CoreError.java
# Conflicts:
#	core/src/main/java/com/scalar/db/common/CoreError.java
Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

Left a minor comment. Other than that, LGTM! Thank you!

@brfrn169 brfrn169 merged commit ddc8d74 into master Oct 29, 2025
187 of 190 checks passed
@brfrn169 brfrn169 deleted the oracle_blob_change branch October 29, 2025 07:45
Torch3333 added a commit that referenced this pull request Oct 31, 2025
…p to 2GB (#3070)

# Conflicts:
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineOracle.java
#	core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTestBase.java

# Conflicts:
#	core/src/main/java/com/scalar/db/common/CoreError.java
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineOracle.java
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineStrategy.java
Torch3333 added a commit that referenced this pull request Oct 31, 2025
…p to 2GB (#3070)

# Conflicts:
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineOracle.java
#	core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTestBase.java

# Conflicts:
#	core/src/main/java/com/scalar/db/common/CoreError.java
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineOracle.java
#	core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineStrategy.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants