Vladsz83 commented on code in PR #11467:
URL: https://github.com/apache/ignite/pull/11467#discussion_r1734453562


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteSchema.java:
##########
@@ -88,4 +91,33 @@ public void removeTable(String tblName) {
     public void addFunction(String name, Function func) {
         funcMap.put(name, func);
     }
+
+    /**
+     * @param name View name.
+     * @param sql View sql.
+     */
+    public void addView(String name, String sql) {
+        viewMap.put(name, sql);
+    }
+
+    /**
+     * @param name View name.
+     */
+    public void removeView(String name) {
+        viewMap.remove(name);
+    }
+
+    /**
+     * Registers current {@code IgniteSchema} in parent {@code schema}.

Review Comment:
   Let's emphasize that parent schema is a SchemaPlus: `{@code schema}` -> 
`{@code SchemaPlus}`



##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteSchema.java:
##########
@@ -88,4 +91,33 @@ public void removeTable(String tblName) {
     public void addFunction(String name, Function func) {
         funcMap.put(name, func);
     }
+
+    /**
+     * @param name View name.
+     * @param sql View sql.
+     */
+    public void addView(String name, String sql) {
+        viewMap.put(name, sql);
+    }
+
+    /**
+     * @param name View name.
+     */
+    public void removeView(String name) {
+        viewMap.remove(name);
+    }
+
+    /**
+     * Registers current {@code IgniteSchema} in parent {@code schema}.
+     *
+     * @param schema Parent schema.
+     * @return Registered schema.
+     */
+    public SchemaPlus register(SchemaPlus schema) {
+        SchemaPlus schemaPlus = schema.add(schemaName, this);
+
+        viewMap.forEach((name, sql) -> schemaPlus.add(name, new 
ViewTableMacroImpl(sql, schemaPlus)));

Review Comment:
   Why only the views?



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