vlsi commented on a change in pull request #1704: [CALCITE-3644] Add
ProjectSetOpTransposeRule to normalize materialized view
URL: https://github.com/apache/calcite/pull/1704#discussion_r366173108
##########
File path: core/src/main/java/org/apache/calcite/rel/mutable/MutableRels.java
##########
@@ -173,6 +173,23 @@ public RexNode get(int index) {
.collect(Collectors.toList());
}
+ /**
+ * Construct expression list of Project by the given fields of the input.
+ */
+ public static List<RexNode> createProjects(final MutableRel child,
+ final List<RexNode> projs) {
+ List<RexNode> rexNodeList = new ArrayList<>();
+ for (int i = 0; i < projs.size(); i++) {
+ if (projs.get(i) instanceof RexInputRef) {
+ RexInputRef rexInputRef = (RexInputRef) projs.get(i);
+ rexNodeList.add(RexInputRef.of(rexInputRef.getIndex(), child.rowType));
+ } else {
Review comment:
What if `RexInputRef` is located inside a `RexCall`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services