Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3221 Move Table API on top of Apache Calcite
  3. FLINK-3223

Translate Table API query into logical relational plans for Apache Calcite

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Implemented
    • None
    • 1.1.0
    • Table SQL / API
    • None

    Description

      This task is about translating Table API queries into logical relational plans for Apache Calcite.

      With the Table API, logical queries are constructed by successive Table API calls such as filter(), select(), and join(). Right now, the Table API checks for semantic validity of the embedded expressions. These check can be removed and delegated to Calcite. The table query construction is roughly equivalent to the parsing step of a SQL query.

      When a Table API query is completely constructed, it is translated into a Calcite RelNode tree, which corresponds to a logical query plan. During this step, the query needs to be semantically checked. Apache Calcite includes a so-called RelBuilder that provides utility methods to construct a tree of RelNodes. It also performs semantic checks while building the tree.

      The result of the translation is a logical relational plan, which is will be optimized and translated by Calcite in the next step.

      For this task we need to:

      • Initialize a Calcite catalog / schema provider with schema information from the TableEnvironment.
      • Simplify the Table API query construction and remove semantic checks and expression rewriting. It should be possible to reuse the current PlanNode representation of the Table API to represent Table API queries.
      • Translate a Table API query into Calcite RelNodes. This means translating a tree of PlanNodes into a RelNode tree using Calciteā€™s RelBuilder.

      Attachments

        Activity

          People

            fhueske Fabian Hueske
            fhueske Fabian Hueske
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: