Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink Common

pyflink.table.table_result.TableResult.get_table_schema#

TableResult.get_table_schema() → pyflink.table.table_schema.TableSchema[source]#

Get the schema of result.

The schema of DDL, USE, EXPLAIN:

+-------------+-------------+----------+
| column name | column type | comments |
+-------------+-------------+----------+
| result      | STRING      |          |
+-------------+-------------+----------+

The schema of SHOW:

+---------------+-------------+----------+
|  column name  | column type | comments |
+---------------+-------------+----------+
| <object name> | STRING      |          |
+---------------+-------------+----------+
The column name of `SHOW CATALOGS` is "catalog name",
the column name of `SHOW DATABASES` is "database name",
the column name of `SHOW TABLES` is "table name",
the column name of `SHOW VIEWS` is "view name",
the column name of `SHOW FUNCTIONS` is "function name".

The schema of DESCRIBE:

+------------------+-------------+-------------------------------------------------+
| column name      | column type |                 comments                        |
+------------------+-------------+-------------------------------------------------+
| name             | STRING      | field name                                      |
+------------------+-------------+-------------------------------------------------+
| type             | STRING      | field type expressed as a String                |
+------------------+-------------+-------------------------------------------------+
| null             | BOOLEAN     | field nullability: true if a field is nullable, |
|                  |             | else false                                      |
+------------------+-------------+-------------------------------------------------+
| key              | BOOLEAN     | key constraint: 'PRI' for primary keys,         |
|                  |             | 'UNQ' for unique keys, else null                |
+------------------+-------------+-------------------------------------------------+
| computed column  | STRING      | computed column: string expression              |
|                  |             | if a field is computed column, else null        |
+------------------+-------------+-------------------------------------------------+
| watermark        | STRING      | watermark: string expression if a field is      |
|                  |             | watermark, else null                            |
+------------------+-------------+-------------------------------------------------+

The schema of INSERT: (one column per one sink)

+----------------------------+-------------+-----------------------+
| column name                | column type | comments              |
+----------------------------+-------------+-----------------------+
| (name of the insert table) | BIGINT      | the insert table name |
+----------------------------+-------------+-----------------------+

The schema of SELECT is the selected field names and types.

Returns

The schema of result.

Return type

pyflink.table.TableSchema

New in version 1.11.0.

previous

pyflink.table.table_result.TableResult.wait

next

pyflink.table.table_result.TableResult.get_result_kind

Show Source

Created using Sphinx 4.5.0.