Github user KurtYoung commented on a diff in the pull request:
https://github.com/apache/flink/pull/3063#discussion_r95304042
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/logical/operators.scala
---
@@ -92,20 +92,19 @@ case class Project(projectList: Seq[NamedExpression],
child: LogicalNode) extend
}
override protected[logical] def construct(relBuilder: RelBuilder):
RelBuilder = {
- val allAlias = projectList.forall(_.isInstanceOf[Alias])
child.construct(relBuilder)
- if (allAlias) {
- // Calcite's RelBuilder does not translate identity projects even if
they rename fields.
- // Add a projection ourselves (will be automatically removed by
translation rules).
- val project = LogicalProject.create(relBuilder.peek(),
+ // Calcite's RelBuilder does not translate identity projects even if
they rename fields.
+ // We add a projection ourselves (will be automatically removed by
translation rules).
+ val project = LogicalProject.create(
--- End diff --
I noticed that Calcite's RelBuilder has this method:
`project(
Iterable<? extends RexNode> nodes,
Iterable<String> fieldNames,
boolean force)`
Would it be more consistent to use this method by setting the force to
`true`, instead of creating Projection by ourself.
But either is fine with me.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---