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

Table API documentation promotes deprecated syntax

    XMLWordPrintableJSON

Details

    Description

      Code examples in java, scala and python showing the overall structure of a Flink Table API job are all using the `tableEnv.connect(...)` syntax, which is deprecated.

      As visible here:

      https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/common.html#structure-of-table-api-and-sql-programs

      For example:

      // create a TableEnvironment for specific planner batch or streaming
      TableEnvironment tableEnv = ...; // see "Create a TableEnvironment" section
      
      // create a Table
      tableEnv.connect(...).createTemporaryTable("table1");
      // register an output Table
      tableEnv.connect(...).createTemporaryTable("outputTable");
      
      // create a Table object from a Table API query
      Table tapiResult = tableEnv.from("table1").select(...);
      

      This is quite missleading since this is one of the first place where Table API code is shown to the reader.

      I suggest I send a small PR to show the executeSql() syntax, which is now preferred.

       

      Attachments

        Issue Links

          Activity

            People

              svend Svend Vanderveken
              svend Svend Vanderveken
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: