-
Notifications
You must be signed in to change notification settings - Fork 40
Revisit handling IS_NULL conditions on right source table columns in LEFT_OUTER virtual tables #3217
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
Merged
brfrn169
merged 3 commits into
master
from
revisit-handling-is-null-conditions-in-left-outer-virtual-tables
Nov 25, 2025
Merged
Revisit handling IS_NULL conditions on right source table columns in LEFT_OUTER virtual tables #3217
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
48 changes: 48 additions & 0 deletions
48
core/src/main/java/com/scalar/db/storage/jdbc/JdbcOperationAttributes.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package com.scalar.db.storage.jdbc; | ||
|
|
||
| import com.scalar.db.api.Delete; | ||
| import com.scalar.db.api.Put; | ||
| import java.util.Map; | ||
|
|
||
| /** A utility class to manipulate the operation attributes for JDBC. */ | ||
| public final class JdbcOperationAttributes { | ||
| private static final String OPERATION_ATTRIBUTE_PREFIX = "jdbc-"; | ||
|
|
||
| public static final String | ||
| LEFT_OUTER_VIRTUAL_TABLE_PUT_IF_IS_NULL_ON_RIGHT_COLUMNS_CONVERSION_ENABLED = | ||
| OPERATION_ATTRIBUTE_PREFIX | ||
| + "left-outer-virtual-table-put-if-is-null-on-right-columns-conversion-enabled"; | ||
|
|
||
| public static final String LEFT_OUTER_VIRTUAL_TABLE_DELETE_IF_IS_NULL_FOR_RIGHT_ALLOWED = | ||
| OPERATION_ATTRIBUTE_PREFIX | ||
| + "left-outer-virtual-table-delete-if-is-null-on-right-columns-allowed"; | ||
brfrn169 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| private JdbcOperationAttributes() {} | ||
|
|
||
| public static boolean isLeftOuterVirtualTablePutIfIsNullOnRightColumnsConversionEnabled(Put put) { | ||
| return put.getAttribute( | ||
| LEFT_OUTER_VIRTUAL_TABLE_PUT_IF_IS_NULL_ON_RIGHT_COLUMNS_CONVERSION_ENABLED) | ||
| .map(Boolean::parseBoolean) | ||
| .orElse(true); | ||
| } | ||
|
|
||
| public static void setLeftOuterVirtualTablePutIfIsNullOnRightColumnsConversionEnabled( | ||
| Map<String, String> attributes, boolean enabled) { | ||
| attributes.put( | ||
| LEFT_OUTER_VIRTUAL_TABLE_PUT_IF_IS_NULL_ON_RIGHT_COLUMNS_CONVERSION_ENABLED, | ||
| Boolean.toString(enabled)); | ||
| } | ||
|
|
||
| public static boolean isLeftOuterVirtualTableDeleteIfIsNullOnRightColumnsAllowed(Delete delete) { | ||
| return delete | ||
| .getAttribute(LEFT_OUTER_VIRTUAL_TABLE_DELETE_IF_IS_NULL_FOR_RIGHT_ALLOWED) | ||
| .map(Boolean::parseBoolean) | ||
| .orElse(false); | ||
| } | ||
|
|
||
| public static void setLeftOuterVirtualTableDeleteIfIsNullOnRightColumnsAllowed( | ||
| Map<String, String> attributes, boolean allowed) { | ||
| attributes.put( | ||
| LEFT_OUTER_VIRTUAL_TABLE_DELETE_IF_IS_NULL_FOR_RIGHT_ALLOWED, Boolean.toString(allowed)); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.