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 <[email protected]>
Date: 2016-10-04T16:32:52Z
[FLINK-3656] [table] Test base for logical unit testing
----
---
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.
---