diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoRules.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoRules.java index 00c14f1c683b..bae5ace361bc 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoRules.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoRules.java @@ -103,9 +103,6 @@ static List mongoFieldNames(final RelDataType rowType) { } static String maybeQuote(String s) { - if (!needsQuote(s)) { - return s; - } return quote(s); } @@ -113,21 +110,6 @@ static String quote(String s) { return "'" + s + "'"; // TODO: handle embedded quotes } - private static boolean needsQuote(String s) { - if (!s.isEmpty() - && (!Character.isJavaIdentifierStart(s.charAt(0)) || s.charAt(0) == '$')) { - return true; - } - - for (int i = 1, n = s.length(); i < n; i++) { - char c = s.charAt(i); - if (!Character.isJavaIdentifierPart(c)) { - return true; - } - } - return false; - } - /** Translator from {@link RexNode} to strings in MongoDB's expression * language. */ static class RexToMongoTranslator extends RexVisitorImpl {