zoov-w commented on code in PR #4452:
URL: https://github.com/apache/calcite/pull/4452#discussion_r2207252207


##########
mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoFilter.java:
##########
@@ -267,5 +292,15 @@ private void translateOp2(String op, String name, 
RexLiteral right,
         multimap.put(name, Pair.of(op, right));
       }
     }
+
+    /** Translates is null/is not null to $exists. */
+    private Void translateUnary(RexCall call,
+        Multimap<String, Pair<String, RexLiteral>> multimap, Map<String, 
RexLiteral> eqMap) {
+      final RexNode left = call.operands.get(0);
+      final RexNode right = 
rexBuilder.makeNullLiteral(rexBuilder.getTypeFactory().createSqlType(SqlTypeName.NULL));
+      String op = call.getKind() == SqlKind.IS_NOT_NULL ? "$ne" : "$eq";

Review Comment:
   Ok, I have added `IS NOT NULL` test and unified code style.



-- 
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]

Reply via email to