You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/12/09 16:53:58 UTC

[jira] [Commented] (FLINK-5084) Replace Java Table API integration tests by unit tests

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

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

Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/2977
  
    Thanks for working on this @mtunique!
    
    I would like to suggest the following. All test classes in `./test/java/org/apache/flink/api/java/batch/table` are split into a validation and a plan test class. All tests are implemented in Scala and moved to the `./test/scala/` directory.
    
    - The validation tests contain the test methods which check for failing validation. These tests are all unit tests and are named like `CalcValidationTest`.
    - The plan test compare the logical plans of the string Table API and the expression Table API. These are also unit tests and named like `CalcPlanTest`. I would not merge these tests with the execution tests of the expression Table API but keep them separate.
    
    The file `./test/java/org/apache/flink/api/java/batch/ExplainTest` can be removed. It checks exactly the same as the Scala version of this test.
    
    What do you think?
    
    Best, Fabian


> Replace Java Table API integration tests by unit tests
> ------------------------------------------------------
>
>                 Key: FLINK-5084
>                 URL: https://issues.apache.org/jira/browse/FLINK-5084
>             Project: Flink
>          Issue Type: Task
>          Components: Table API & SQL
>            Reporter: Fabian Hueske
>            Priority: Minor
>
> The Java Table API is a wrapper on top of the Scala Table API. 
> Instead of operating directly with Expressions like the Scala API, the Java API accepts a String parameter which is parsed into Expressions.
> We could therefore replace the Java Table API ITCases by tests that check that the parsing step produces a valid logical plan.
> This could be done by creating two {{Table}} objects for an identical query once with the Scala Expression API and one with the Java String API and comparing the logical plans of both {{Table}} objects. Basically something like the following:
> {code}
> val ds1 = CollectionDataSets.getSmall3TupleDataSet(env).toTable(tEnv, 'a, 'b, 'c)
> val ds2 = CollectionDataSets.get5TupleDataSet(env).toTable(tEnv, 'd, 'e, 'f, 'g, 'h)
> val joinT1 = ds1.join(ds2).where('b === 'e).select('c, 'g)
> val joinT2 = ds1.join(ds2).where("b = e").select("c, g")
> val lPlan1 = joinT1.logicalPlan
> val lPlan2 = joinT2.logicalPlan
> Assert.assertEquals("Logical Plans do not match", lPlan1, lPlan2)
> {code}



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