-
Notifications
You must be signed in to change notification settings - Fork 41
For Oracle, allow importing a table with NUMBER(1) data type to a ScalarDB BOOLEAN #3239
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
|
/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 correctly implements the feature to allow importing Oracle's NUMBER(1) data type as a BOOLEAN when an override is specified. The changes are well-contained, and both integration and unit tests have been updated to cover the new functionality and ensure existing behavior is not broken. I have one minor suggestion to improve maintainability by using a constant for a magic number.
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 enables Oracle NUMBER(1) columns to be mapped to ScalarDB BOOLEAN data type during table import operations. Previously, NUMBER(1) was automatically mapped to BIGINT, which was inconsistent with Oracle's convention of using NUMBER(1) to represent boolean values. The change allows users to override this mapping using the override-columns-type setting in ScalarDB Schema Loader.
- Added conditional logic in
RdbEngineOracleto mapNUMBER(1)to BOOLEAN when explicitly overridden - Enhanced test coverage to verify both default behavior (NUMBER(1) → BIGINT) and override behavior (NUMBER(1) → BOOLEAN)
- Extended integration tests to validate the end-to-end override functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineOracle.java | Implements the core logic to support NUMBER(1) to BOOLEAN override in the getDataTypeForScalarDbInternal method |
| core/src/test/java/com/scalar/db/storage/jdbc/RdbEngineTest.java | Adds unit test cases for both the override behavior and default BIGINT mapping of Oracle NUMBER(1) |
| core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminImportTestUtils.java | Extends integration test with a new column (col22) to validate NUMBER(1) to BOOLEAN override functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
brfrn169
left a comment
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!
feeblefakie
left a comment
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!
komamitsu
left a comment
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! 👍
…larDB BOOLEAN (#3239) # Conflicts: # core/src/test/java/com/scalar/db/storage/jdbc/RdbEngineTest.java
Description
The Oracle
NUMBER(1)data type is used to map ScalarDB BOOLEAN. Though when importing a table with a column with this data type, the type will automatically be mapped to a ScalarDB BIGINT.This PR adds the possibility to override the data type mapping to ScalarDB BOOLEAN.
Related issues and/or PRs
N/A
Changes made
NUMBER(1)data type to BOOLEAN.Checklist
Additional notes (optional)
N/A
Release notes
On Oracle, when importing a table with a column using the
NUMBER(1)data type, which is usually used for BOOLEAN data, that column can now be mapped to ScalarDB BOOLEAN using ScalarDB Schema Loaderoverride-columns-typesetting.