chunweilei commented on a change in pull request #1355: [CALCITE-3228] Error 
while applying rule ProjectScanRule: interpreter
URL: https://github.com/apache/calcite/pull/1355#discussion_r310851099
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/rules/ProjectTableScanRule.java
 ##########
 @@ -103,12 +103,12 @@ protected static boolean test(TableScan scan) {
   protected void apply(RelOptRuleCall call, Project project, TableScan scan) {
     final RelOptTable table = scan.getTable();
     assert table.unwrap(ProjectableFilterableTable.class) != null;
-
-    final Mappings.TargetMapping mapping = project.getMapping();
-    if (mapping == null
-        || Mappings.isIdentity(mapping)) {
+    if (!project.isMapping()) {
       return;
     }
+    final Mappings.TargetMapping mapping = Project.getPartialMapping(
+            project.getInput().getRowType().getFieldCount(),
+            project.getProjects());
 
 Review comment:
   I am wondering if you can open another jira ticket for this. Therefore you 
can open a pull request for it. Thanks~

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

Reply via email to