xiedeyantu commented on code in PR #4727:
URL: https://github.com/apache/calcite/pull/4727#discussion_r2666586855
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -4842,6 +4844,58 @@ private static class IsNotDistinctFromImplementor
extends AbstractRexCallImpleme
}
}
+ /** Implementor for the {@code IS DISTINCT FROM} SQL operator. */
+ private static class IsDistinctFromImplementor extends
AbstractRexCallImplementor {
+ IsDistinctFromImplementor() {
+ super("is_distinct_from", NullPolicy.NONE, false);
+ }
+
+ @Override public RexToLixTranslator.Result implement(
+ final RexToLixTranslator translator,
+ final RexCall call,
+ final List<RexToLixTranslator.Result> arguments) {
+ final RexToLixTranslator.Result left = arguments.get(0);
+ final RexToLixTranslator.Result right = arguments.get(1);
+
+ // Generated expression:
+ // left IS NULL ?
+ // (right IS NULL ? FALSE : TRUE) : -> when left is null
+ // (right IS NULL ? TRUE : -> when left is not null
+ // !left.equals(right)) -> when both are not null,
compare values
+ final Expression equalsExpression =
Review Comment:
This is a very interesting topic, and I’ll refine it further later. If you
have time, could you provide a bit more information to help me understand where
the risks in the current implementation might lie?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]