xiedeyantu commented on code in PR #4260:
URL: https://github.com/apache/calcite/pull/4260#discussion_r2015619037
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -4741,6 +4743,47 @@ private static class IsNullImplementor extends
AbstractRexCallImplementor {
}
}
+ /** Implementor for the {@code IS NOT DISTINCT FROM} SQL operator. */
+ private static class IsNotDistinctFromImplementor extends
AbstractRexCallImplementor {
+ IsNotDistinctFromImplementor() {
+ super("is_not_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);
+
+ final Expression valueExpression =
+ Expressions.condition(left.isNullVariable,
+ Expressions.condition(right.isNullVariable, BOXED_TRUE_EXPR,
BOXED_FALSE_EXPR),
+ Expressions.condition(right.isNullVariable, BOXED_FALSE_EXPR,
+ Expressions.equal(left.valueVariable, right.valueVariable)));
+
+ BlockBuilder builder = translator.getBlockBuilder();
+ final ParameterExpression valueVariable =
+ Expressions.parameter(valueExpression.getType(),
+ builder.newName(variableName + "_value"));
+ final Expression isNullExpression = FALSE_EXPR;
+ final ParameterExpression isNullVariable =
Review Comment:
Fixed
--
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]