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_environment.TableEnvironment.sql_query#

TableEnvironment.sql_query(query: str) → pyflink.table.table.Table[source]#

Evaluates a SQL query on registered tables and retrieves the result as a Table.

All tables referenced by the query must be registered in the TableEnvironment.

A Table is automatically registered when its __str__() method is called, for example when it is embedded into a String.

Hence, SQL queries can directly reference a Table as follows:

>>> table = ...
# the table is not registered to the table environment
>>> table_env.sql_query("SELECT * FROM %s" % table)
Parameters

query – The sql query string.

Returns

The result table.

previous

pyflink.table.table_environment.TableEnvironment.set_python_requirements

next

pyflink.table.table_environment.TableEnvironment.unload_module

Show Source

Created using Sphinx 4.5.0.