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



##########
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:
       @vvysotskyi I aimed here to work according to the existing design as I 
saw it.  DynamicRootSchema is a subtype of CalciteSchema which is a wrapper 
around a Schema stored in a member variable.  In the case of CalciteSchema it 
is the wrapped Schema that implements getSubSchema and getSubSchemaNames, not 
the CalciteSchema wrapper.  So I reasoned that for the case of 
DynamicRootSchema, the wrapped RootSchema should implement, indeed override, 
the mentioned methods.




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