Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.set_table_environment#

set_table_environment(t_env: Optional[StreamTableEnvironment]) → None[source]#

Set the global TableEnvironment for DataFrame operations.

This is useful in testing scenarios where you want to reuse the same TableEnvironment across multiple DataFrame creations.

Parameters

t_env – The TableEnvironment to use globally. Pass None to reset.

Example::
>>> import pyflink.dataframe as pf
>>> # In test setup
>>> pf.set_table_environment(self.t_env)
>>> # Now from_records, from_dict will use this t_env
>>> df = pf.from_records([(1, 2)], schema=["a", "b"])
>>> # In test teardown
>>> pf.set_table_environment(None)

previous

pyflink.dataframe.context.DataFrameConfig.get

next

pyflink.dataframe.get_table_environment

Show Source

Created using Sphinx 4.5.0.