[ 
https://issues.apache.org/jira/browse/FLINK-3656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15548219#comment-15548219
 ] 

ASF GitHub Bot commented on FLINK-3656:
---------------------------------------

GitHub user twalthr opened a pull request:

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

    [FLINK-3656] [table] Test base for logical unit testing

    This PR introduces a test base for logical unit testing. It could replace 
most of current ITCases as it checks if the API is correctly translated into 
`DataSet`/`DataStream` RelNodes. The translation to DataSet/DataStream 
operators should be tested separately by unit tests for those (e.g. 
`DataSetCalcTest`, `DataSetJoinTest` etc.).
    
    Here is an example how a JointITCase could be converted:
    ```scala
    @Test
    def testJoin(): Unit = {
    val util = batchTestUtil()
    val in1 = util.addTable[(Int, Long, String)]("Left", 'a, 'b, 'c)
    val in2 = util.addTable[(Int, Long, Int, String, Long)]("Right", 'd, 'e, 
'f, 'g, 'h)
    
    val table = in1.join(in2).where("b === e").select("c, g")
    
    val expected = unaryNode(
      "DataSetCalc",
      binaryNode(
        "DataSetJoin",
        batchTableNode(0),
        batchTableNode(1),
        term("where", "=(b, e)"),
        term("join", "a", "b", "c", "d", "e", "f", "g", "h")
      ),
      term("joinType", "Join")
    )
    
    util.verifyTable(table, expected)
    }
    ```
    


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

    $ git pull https://github.com/twalthr/flink FLINK-3656_UNIT_TEST_UTILS

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

    https://github.com/apache/flink/pull/2595.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 #2595
    
----
commit c384628cd1f48f993973bb2e831720a98d55ca16
Author: twalthr <twal...@apache.org>
Date:   2016-10-04T16:32:52Z

    [FLINK-3656] [table] Test base for logical unit testing

----


> Rework Table API tests
> ----------------------
>
>                 Key: FLINK-3656
>                 URL: https://issues.apache.org/jira/browse/FLINK-3656
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Vasia Kalavri
>              Labels: starter
>
> The Table API tests are very inefficient. At the moment It is mostly 
> end-to-end integration tests, often testing the same functionality several 
> times (Java/Scala, DataSet/DataStream).
> We should look into how we can rework the Table API tests such that:
> - long-running integration tests are converted into faster unit tests
> - common parts of DataSet and DataStream are only tested once
> - common parts of Java and Scala Table APIs are only tested once
> - duplicate tests are completely removed



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to