vldpyatkov commented on code in PR #13545:
URL: https://github.com/apache/ignite/pull/13545#discussion_r3924946899


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteSchema.java:
##########
@@ -143,6 +150,17 @@ public SchemaPlus register(SchemaPlus parent, 
FrameworkConfig frameworkCfg) {
 
         viewMap.forEach((name, sql) -> newSchema.add(name, new 
ViewTableMacroImpl(sql, newSchema, frameworkCfg)));
 
+        registerDualTableIfSupported(newSchema, frameworkCfg);
+
         return newSchema;
     }
+
+    /** */
+    private static void registerDualTableIfSupported(SchemaPlus schema, 
FrameworkConfig frameworkCfg) {
+        if (frameworkCfg != null && 
frameworkCfg.getParserConfig().conformance().isSupportedDualTable()
+            && schema.tables().get(DUAL_TBL_NAME) == null
+            && 
schema.getFunctions(DUAL_TBL_NAME).stream().noneMatch(TableMacro.class::isInstance))
 {
+            schema.add(DUAL_TBL_NAME, new ViewTableMacroImpl(DUAL_TBL_VIEW, 
schema, frameworkCfg));

Review Comment:
   I’m not sure whether we really need this, but Calcite supports this 
property. If we decide to support it, let’s implement it the same way as 
Calcite does, because its implementation also works with grammars that do not 
allow SELECT without a FROM clause.
   `VALUES ('X')`



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