You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/02/10 19:24:21 UTC

[GitHub] [calcite] vlsi commented on a change in pull request #1792: [CALCITE-3775] Implicit lookup methods in SimpleCalciteSchema ignore case sensitivity parameter

vlsi commented on a change in pull request #1792: [CALCITE-3775] Implicit lookup methods in SimpleCalciteSchema ignore case sensitivity parameter
URL: https://github.com/apache/calcite/pull/1792#discussion_r377267039
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java
 ##########
 @@ -70,28 +69,29 @@ public CalciteSchema add(String name, Schema schema) {
   protected CalciteSchema getImplicitSubSchema(String schemaName,
       boolean caseSensitive) {
     // Check implicit schemas.
-    Schema s = schema.getSubSchema(schemaName);
-    if (s != null) {
-      return new SimpleCalciteSchema(this, s, schemaName);
+    final NameSet names = NameSet.immutableCopyOf(schema.getSubSchemaNames());
+    for (String schemaName2: names.range(schemaName, caseSensitive)) {
+      return new SimpleCalciteSchema(this,
+          schema.getSubSchema(schemaName2), schemaName);
     }
     return null;
   }
 
   protected TableEntry getImplicitTable(String tableName,
       boolean caseSensitive) {
     // Check implicit tables.
-    Table table = schema.getTable(tableName);
-    if (table != null) {
-      return tableEntry(tableName, table);
+    final NameSet names = NameSet.immutableCopyOf(schema.getTableNames());
+    for (String tableName2: names.range(tableName, caseSensitive)) {
 
 Review comment:
   Is this acceptable for performance?
   Copying all the tables does not look OK for each `get...` call.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services