xuzifu666 commented on code in PR #5274:
URL: https://github.com/apache/calcite/pull/5274#discussion_r4051888073


##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -367,15 +368,40 @@ public RelFactories.TableScanFactory getScanFactory() {
    * you need to use previously built expressions as inputs, call
    * {@link #build()} to pop those inputs. */
   public RelBuilder push(RelNode node) {
-    stack.push(new Frame(node));
+    stackPush(node);
     return this;
   }
 
   /** Adds a rel node to the top of the stack while preserving the field names
    * and aliases. */
   private void replaceTop(RelNode node) {
     final Frame frame = stack.pop();
-    stack.push(new Frame(node, frame.fields));
+    stackPush(node, frame.fields);
+  }
+
+  /** Adds a relational expression to the stack, checking the
+   * {@link Config#emptyRowTypePolicy()}. */
+  private void stackPush(RelNode rel) {
+    checkEmptyRowType(rel);
+    stack.push(new Frame(rel));
+  }
+
+  /** Adds a relational expression to the stack, checking the
+   * {@link Config#emptyRowTypePolicy()}. */
+  private void stackPush(RelNode rel,

Review Comment:
   Thank you for the suggestion, @julianhyde  done in the latest commit.



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