You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by kaibozhou <gi...@git.apache.org> on 2017/02/20 06:00:28 UTC

[GitHub] flink pull request #3357: [FLINK-5566] [table] Exception when do filter afte...

GitHub user kaibozhou opened a pull request:

    https://github.com/apache/flink/pull/3357

    [FLINK-5566] [table] Exception when do filter after join a UDTF which returns a POJO type

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [x] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ ] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    
    
    This PR will fix the case:  do filter after join a UDTF which returns a POJO type

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kaibozhou/flink flink-5827

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3357.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 #3357
    
----
commit 0abc4f471f93a5f68ec67c27e8e94f531c36de94
Author: \u5b9d\u725b <ba...@taobao.com>
Date:   2017-02-20T05:43:07Z

    [FLINK-5566] [table] Exception when do filter after join a udtf which returns a POJO type

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3357: [FLINK-5827] [table] Exception when do filter afte...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/3357


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3357: [FLINK-5827] [table] Exception when do filter afte...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3357#discussion_r102498672
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/TableWithSQLITCase.scala ---
    @@ -113,4 +114,26 @@ class TableWithSQLITCase(
         val results = result.toDataSet[Row].collect()
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
    +
    +  @Test
    +  def testUDTFWithPojoType(): Unit = {
    --- End diff --
    
    We should keep ITCases to a very minimum, because they are very expensive. Espacially, we should not add 4 ITCases for a one line change. I think it is sufficient if we just extend an existing test in `DataSetUserDefinedFunctionITCase` and `DataStreamUserDefinedFunctionITCase`. You could e.g. rename `testLongAndTemporalTypes` to `testDifferentTypes` and add a POJO there.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3357: [FLINK-5827] [table] Exception when do filter afte...

Posted by kaibozhou <gi...@git.apache.org>.
Github user kaibozhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3357#discussion_r102693470
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/TableWithSQLITCase.scala ---
    @@ -113,4 +114,26 @@ class TableWithSQLITCase(
         val results = result.toDataSet[Row].collect()
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
    +
    +  @Test
    +  def testUDTFWithPojoType(): Unit = {
    --- End diff --
    
    I found there was already a testPojoType case in DataSetUserDefinedFunctionITCase, so I extend it. And I extend testCrossJoin in DataStreamUserDefinedFunctionITCase, do you think it's OK?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3357: [FLINK-5827] [table] Exception when do filter afte...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3357#discussion_r102497060
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/CommonCorrelate.scala ---
    @@ -188,7 +189,12 @@ trait CommonCorrelate {
             |getCollector().collect(${crossResultExpr.resultTerm});
             |""".stripMargin
         } else {
    -      val filterGenerator = new CodeGenerator(config, false, udtfTypeInfo)
    +      val filterGenerator =
    +        udtfTypeInfo match {
    +          case pt: PojoTypeInfo[_] => new CodeGenerator(config, false, udtfTypeInfo, None,
    --- End diff --
    
    I think we don't need a pattern matching here. `pojoFieldMapping` is option anyway so we can pass it directly.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3357: [FLINK-5827] [table] Exception when do filter after join ...

Posted by kaibozhou <gi...@git.apache.org>.
Github user kaibozhou commented on the issue:

    https://github.com/apache/flink/pull/3357
  
    Hi @twalthr , thank you for the reviewing. I have updated the PR according to your comments.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3357: [FLINK-5827] [table] Exception when do filter afte...

Posted by kaibozhou <gi...@git.apache.org>.
Github user kaibozhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3357#discussion_r102692495
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/CommonCorrelate.scala ---
    @@ -188,7 +189,12 @@ trait CommonCorrelate {
             |getCollector().collect(${crossResultExpr.resultTerm});
             |""".stripMargin
         } else {
    -      val filterGenerator = new CodeGenerator(config, false, udtfTypeInfo)
    +      val filterGenerator =
    +        udtfTypeInfo match {
    +          case pt: PojoTypeInfo[_] => new CodeGenerator(config, false, udtfTypeInfo, None,
    --- End diff --
    
    yes, it's not need to match a pattern here


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3357: [FLINK-5827] [table] Exception when do filter after join ...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on the issue:

    https://github.com/apache/flink/pull/3357
  
    Thanks @kaibozhou. I will merge this.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---