Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Discussion thread: here (http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-FLIP-84-Improve-amp-Refactor-API-of-Table-Module-td34537.html)

JIRA: here (<- link to https://issues.apache.org/jira/browse/FLINK-XXXX)

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyFLINK-16361

Released: <Flink Version>

...

The following table describes the result for each kind of statement:

Statement

Result ScheamSchema

Result Value

Examples

DDL

field name: result

field type: VARCHAR(2)

"OK"

(single row)

CREATE TABLE new_table (col1 BIGINT, ...)

DML

(INSERT/UPDATE/DELETE)

field name: affected_rowcount

field type: BIGINT

the affected row count

(-1 means unknown)

INSERT INTO sink_table SELECT …  

SHOW xx

field name: result

field type: VARCHAR(n)

(n is the max length of values)

list all objects

(multiple rows)

SHOW CATALOGS

DESCRIBE xx

describe the detail of an object 

(single row)

DESCRIBE CATALOG catalog_name

EXPLAIN xx

explain the plan of a query

(single row)

EXPLAIN PLAN FOR SELECT …

USE xx

field name: result

field type: VARCHAR(2)

"OK"

(single row)

USE CATALOG catalog_name

...

  1. Methods of TableEnvironment to be deprecated:
    • void sqlUpdate(String sql)
    • void insertInto(String targetPath, Table table)
    • JobExecutionResult execute(String jobName)
    • String explain(boolean extended)
    • Table fromTableSource(TableSource tableSource)
  2. You may need to change to the program a little if you use `StreamExecutionEnvironment.execute` to trigger a table program execution or use `StreamTableEnvironment.execute()` to trigger a DataStream program execution.

Test Plan

The `DmlBatch#explain` method can be tested with unit tests, and other new methods can be tested with integration tests. We will also add some integration tests to verify the new methods can work with the deprecated methods correctly.

...