vvysotskyi commented on a change in pull request #2388:
URL: https://github.com/apache/drill/pull/2388#discussion_r781253084



##########
File path: 
exec/java-exec/src/main/java/org/apache/calcite/jdbc/DynamicRootSchema.java
##########
@@ -154,10 +157,25 @@ private void loadSchemaFactory(String schemaName, boolean 
caseSensitive) {
     }
   }
 
-  static class RootSchema extends AbstractSchema {
+  public static class RootSchema extends AbstractSchema {
 
-    public RootSchema() {
+    private StoragePluginRegistry storages;
+
+    private DynamicRootSchema dynRootSchema;
+
+    public RootSchema(StoragePluginRegistry storages) {
       super(Collections.emptyList(), ROOT_SCHEMA_NAME);
+      this.storages = storages;
+    }
+
+    @Override
+    public Set<String> getSubSchemaNames() {
+      return storages.availablePlugins();
+    }
+
+    @Override
+    public Schema getSubSchema(String name) {

Review comment:
       I think the case of `DynamicRootSchema` is the special one, since it 
overrides the parent method `getImplicitSubSchema()` that uses the 
`Schema.getSubSchema()` method in the parent class. I think it was done 
intentionally, in the opposite case all the logic related to loading schemas 
simple would be placed in the `RootSchema`.




-- 
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: dev-unsubscr...@drill.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to