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.StreamTableEnvironment.use_catalog#

StreamTableEnvironment.use_catalog(catalog_name: str)#

Sets the current catalog to the given value. It also sets the default database to the catalog’s default one. See also use_database().

This is used during the resolution of object paths. Both the catalog and database are optional when referencing catalog objects such as tables, views etc. The algorithm looks for requested objects in following paths in that order:

  • [current-catalog].[current-database].[requested-path]

  • [current-catalog].[requested-path]

  • [requested-path]

Example:

Given structure with default catalog set to default_catalog and default database set to default_database.

root:
  |- default_catalog
      |- default_database
          |- tab1
      |- db1
          |- tab1
  |- cat1
      |- db1
          |- tab1

The following table describes resolved paths:

Requested path

Resolved path

tab1

default_catalog.default_database.tab1

db1.tab1

default_catalog.db1.tab1

cat1.db1.tab1

cat1.db1.tab1

Parameters

catalog_name – The name of the catalog to set as the current default catalog.

Throws

CatalogException thrown if a catalog with given name could not be set as the default one.

See also

use_database()

previous

pyflink.table.table_environment.StreamTableEnvironment.unload_module

next

pyflink.table.table_environment.StreamTableEnvironment.use_database

Show Source

Created using Sphinx 4.5.0.