@@ -396,11 +396,9 @@ private List<Put> dividePutForSourceTables(Put put, VirtualTableInfo virtualTabl
396396 putBuilderForLeftSourceTable .condition (ConditionBuilder .putIf (leftExpressions ));
397397 }
398398 if (!rightExpressions .isEmpty ()) {
399- if (virtualTableInfo . getJoinType () == VirtualTableJoinType . LEFT_OUTER
399+ if (isAllIsNullOnRightColumnsInLeftOuterJoin ( virtualTableInfo , rightExpressions )
400400 && JdbcOperationAttributes
401- .isLeftOuterVirtualTablePutIfIsNullOnRightColumnsConversionEnabled (put )
402- && rightExpressions .stream ()
403- .allMatch (e -> e .getOperator () == ConditionalExpression .Operator .IS_NULL )) {
401+ .isLeftOuterVirtualTablePutIfIsNullOnRightColumnsConversionEnabled (put )) {
404402 // In a LEFT_OUTER join, when all conditions on the right source table columns are
405403 // IS_NULL, we cannot distinguish whether we should check for the existence of a
406404 // right-side record with NULL values or for the case where the right-side record does
@@ -479,11 +477,9 @@ private List<Delete> divideDeleteForSourceTables(Delete delete, VirtualTableInfo
479477 deleteBuilderForLeftSourceTable .condition (ConditionBuilder .deleteIf (leftExpressions ));
480478 }
481479 if (!rightExpressions .isEmpty ()) {
482- if (virtualTableInfo . getJoinType () == VirtualTableJoinType . LEFT_OUTER
480+ if (isAllIsNullOnRightColumnsInLeftOuterJoin ( virtualTableInfo , rightExpressions )
483481 && !JdbcOperationAttributes
484- .isLeftOuterVirtualTableDeleteIfIsNullOnRightColumnsAllowed (delete )
485- && rightExpressions .stream ()
486- .allMatch (e -> e .getOperator () == ConditionalExpression .Operator .IS_NULL )) {
482+ .isLeftOuterVirtualTableDeleteIfIsNullOnRightColumnsAllowed (delete )) {
487483 // In a LEFT_OUTER join, when all conditions on the right source table columns are
488484 // IS_NULL, we cannot distinguish whether we should check for the existence of a
489485 // right-side record with NULL values or for the case where the right-side record does
@@ -509,6 +505,13 @@ private List<Delete> divideDeleteForSourceTables(Delete delete, VirtualTableInfo
509505 return Arrays .asList (deleteForLeftSourceTable , deleteForRightSourceTable );
510506 }
511507
508+ private boolean isAllIsNullOnRightColumnsInLeftOuterJoin (
509+ VirtualTableInfo virtualTableInfo , List <ConditionalExpression > rightExpressions ) {
510+ return virtualTableInfo .getJoinType () == VirtualTableJoinType .LEFT_OUTER
511+ && rightExpressions .stream ()
512+ .allMatch (e -> e .getOperator () == ConditionalExpression .Operator .IS_NULL );
513+ }
514+
512515 private void close (Connection connection ) {
513516 try {
514517 if (connection != null ) {
0 commit comments