Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-5084

Replace Java Table API integration tests by unit tests

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      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:

      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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fhueske Fabian Hueske
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: