zabetak commented on a change in pull request #1020: [CALCITE-2812] Add 
algebraic operators to allow expressing recursive queries (Ruben Quesada Lopez)
URL: https://github.com/apache/calcite/pull/1020#discussion_r258433355
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1616,6 +1619,58 @@ public RelBuilder minus(boolean all, int n) {
     return setOp(all, SqlKind.EXCEPT, n);
   }
 
+  /**
+   * Creates a {@link LogicalDeltaTableScan} of a delta work table (used to 
accumulate results in
+   * recursive union operation), using as its row type the top of the stack.
+   * Returns this builder.
+   */
+  public RelBuilder deltaScan(String tableName) {
+    return this.deltaScan(tableName, this.peek().getRowType());
+  }
+
+  /**
+   * Creates a {@link LogicalDeltaTableScan} of a delta work table (used to 
accumulate results in
+   * recursive union operation).
+   * Returns this builder.
+   * @param tableName table name
+   * @param rowType row type of the table
+   */
+  public RelBuilder deltaScan(String tableName, RelDataType rowType) {
+    RelOptTable table = RelOptTableImpl.create(
+            this.relOptSchema,
+            rowType,
+            Collections.singletonList(tableName),
+            null);
+    LogicalDeltaTableScan scan = LogicalDeltaTableScan.create(this.cluster, 
table);
 
 Review comment:
   Regarding my previous comment of possibly removing LogicalDeltaTableScan 
(replacing with LogicalTableScan) I was thinking that the RelOptTableImpl above 
could be enhanced with adequate information which would make the need for a new 
scan operator obsolete.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to