rubenada commented on a change in pull request #2015:
URL: https://github.com/apache/calcite/pull/2015#discussion_r438861088
##########
File path: core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
##########
@@ -417,17 +417,30 @@ public TrimResult trimFields(
relBuilder.push(newInput);
relBuilder.project(newProjects, newRowType.getFieldNames());
- return result(relBuilder.build(), mapping);
+ final RelNode newProject = RelOptUtil.propagateRelHints(project,
relBuilder.build());
+ return result(newProject, mapping);
}
/** Creates a project with a dummy column, to protect the parts of the system
* that cannot handle a relational expression with no columns.
*
* @param fieldCount Number of fields in the original relational expression
* @param input Trimmed input
- * @return Dummy project, or null if no dummy is required
+ * @return Dummy project
*/
protected TrimResult dummyProject(int fieldCount, RelNode input) {
+ return dummyProject(fieldCount, input, null);
+ }
+
+ /** Creates a project with a dummy column, to protect the parts of the system
+ * that cannot handle a relational expression with no columns.
+ *
+ * @param fieldCount Number of fields in the original relational expression
+ * @param input Trimmed input
+ * @param originalRelNode Source RelNode for hint propagation (or null if no
propagation needed)
+ * @return Dummy project
+ */
+ protected TrimResult dummyProject(int fieldCount, RelNode input, RelNode
originalRelNode) {
final RelOptCluster cluster = input.getCluster();
Review comment:
uhmm... I thought we required the RelNode (not just the hints) in order
to use `RelOptUtil#propagateRelHints(RelNode originalRel, RelNode equiv)`
----------------------------------------------------------------
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]