DonnyZone commented on a change in pull request #2453:
URL: https://github.com/apache/calcite/pull/2453#discussion_r664983372



##########
File path: core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java
##########
@@ -74,33 +76,73 @@ private SimpleCalciteSchema(@Nullable CalciteSchema parent,
     return calciteSchema;
   }
 
+  private @Nullable String caseInsensitiveLookup(Set<String> candidates, 
String name) {
+    // Exact string lookup
+    if (candidates.contains(name)) {
+      return name;
+    }
+    // Upper case string lookup
+    final String upperCaseName = name.toUpperCase(Locale.ROOT);
+    if (candidates.contains(upperCaseName)) {
+      return upperCaseName;
+    }
+    // Lower case string lookup
+    final String lowerCaseName = name.toLowerCase(Locale.ROOT);
+    if (candidates.contains(lowerCaseName)) {
+      return lowerCaseName;
+    }
+    // Fall through: Set iteration
+    for (String candidate: candidates) {
+      if (candidate.equalsIgnoreCase(name)) {
+        return candidate;
+      }
+    }
+    return null;
+  }
+
+

Review comment:
       Nitpicking: extra line




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