[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user fhueske closed the pull request at: https://github.com/apache/flink/pull/1738 --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user fhueske commented on the pull request: https://github.com/apache/flink/pull/1738#issuecomment-191670391 Merged to `tableOnCalcite` --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user fhueske commented on the pull request: https://github.com/apache/flink/pull/1738#issuecomment-191502994 Will merge this to `tableOnCalcite` branch. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user fhueske commented on the pull request: https://github.com/apache/flink/pull/1738#issuecomment-190276423 I fixed the failing tests. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/1738#discussion_r54430812 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/table.scala --- @@ -98,7 +100,19 @@ class Table( .map(toRexNode(_, relBuilder)) relBuilder.project(exprs.toIterable.asJava) -new Table(relBuilder.build(), relBuilder) +var projected = relBuilder.build() + +if(relNode == projected) { + // 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 names = exprs.map(_.asInstanceOf[RexCall].getOperands.get(1) --- End diff -- Woops! Thanks, I'll check that. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
Github user vasia commented on a diff in the pull request: https://github.com/apache/flink/pull/1738#discussion_r54430318 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/table.scala --- @@ -98,7 +100,19 @@ class Table( .map(toRexNode(_, relBuilder)) relBuilder.project(exprs.toIterable.asJava) -new Table(relBuilder.build(), relBuilder) +var projected = relBuilder.build() + +if(relNode == projected) { + // 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 names = exprs.map(_.asInstanceOf[RexCall].getOperands.get(1) --- End diff -- This cast to `RexCall` seems to cause several tests to fail. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] flink pull request: [FLINK-3486] [tableAPI] Fix broken renaming of...
GitHub user fhueske opened a pull request: https://github.com/apache/flink/pull/1738 [FLINK-3486] [tableAPI] Fix broken renaming of all fields. You can merge this pull request into a Git repository by running: $ git pull https://github.com/fhueske/flink tableAllRenameFix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/1738.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1738 commit de6dd97a79549b3d2d38c294e21c4027788b2f90 Author: Fabian HueskeDate: 2016-02-29T15:34:24Z [FLINK-3486] [tableAPI] Fix broken renaming of all fields. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---