dssysolyatin commented on code in PR #3896:
URL: https://github.com/apache/calcite/pull/3896#discussion_r1700030806


##########
mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoRules.java:
##########
@@ -114,10 +114,14 @@ static String quote(String s) {
   }
 
   private static boolean needsQuote(String s) {
-    for (int i = 0, n = s.length(); i < n; i++) {
+    if (!s.isEmpty()

Review Comment:
   I don't think so, because $ in the middle will work in any case, whether 
quoted or unquoted. Instead of writing all possible tests for quoting, it would 
be better to rewrite the Mongo adapter to use MongoDB builders. This way, we 
can avoid such mistakes.
   
   See: https://issues.apache.org/jira/browse/CALCITE-6510



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