Skip to content

Commit 6b82cb2

Browse files
committed
add booleanValueTest
1 parent 6af3ef8 commit 6b82cb2

File tree

2 files changed

+138
-3
lines changed
  • fdb-record-layer-core/src

2 files changed

+138
-3
lines changed

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/RelOpValue.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,15 @@ private enum BinaryPhysicalOperator {
10741074

10751075
@Nullable
10761076
public Object eval(@Nullable final Object arg1, @Nullable final Object arg2) {
1077+
// handle nulls
10771078
if (arg1 == null || arg2 == null) {
1078-
return null;
1079+
if (type == Comparisons.Type.IS_DISTINCT_FROM) {
1080+
return arg1 != null || arg2 != null;
1081+
} else if (type == Comparisons.Type.NOT_DISTINCT_FROM) {
1082+
return arg1 == null && arg2 == null;
1083+
} else {
1084+
return null;
1085+
}
10791086
}
10801087
return evaluateFunction.apply(arg1, arg2);
10811088
}

0 commit comments

Comments
 (0)