snowflake.core.dynamic_table.DynamicTableResource | Snowflake Documentation (original) (raw)

DeveloperSnowflake Python APIsSnowflake Python APIs referencedynamic_tabledynamic_table.DynamicTableResource

class snowflake.core.dynamic_table.DynamicTableResource(name: str, collection: DynamicTableCollection)

Bases: SchemaObjectReferenceMixin[DynamicTableCollection]

Represents a reference to a Snowflake dynamic table.

With this dynamic table reference, you can create, drop, undrop, suspend, resume, swap_with other table, suspend recluster, resume recluster and fetch information about dynamic tables, as well as perform certain actions on them.

Attributes

database

The DatabaseResource this reference belongs to.

fully_qualified_name

Return the fully qualified name of the object this reference points to.

root

The Root object this reference belongs to.

Methods

delete() → None

The delete method is deprecated; use drop instead.

drop(if_exists: bool | None = None) → None

Drop the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before dropping it. Default is None, which is equivalent to False.

Examples

Deleting a dynamic table using its reference:

dynamic_table_reference.drop()

drop_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of drop().

Refer to PollingOperation for more information on asynchronous execution and the return type.

fetch() → DynamicTable

Fetch the details of a dynamic table.

Examples

Fetching a reference to a dynamic table to print its name and query properties:

my_dynamic_table = dynamic_table_reference.fetch() print(my_dynamic_table.name, my_dynamic_table.query)

fetch_async() → PollingOperation[DynamicTable]

An asynchronous version of fetch().

Refer to PollingOperation for more information on asynchronous execution and the return type.

refresh(if_exists: bool | None = None) → None

Refresh the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before refreshing it. Default is None, which is equivalent to False.

Examples

Refreshing a dynamic table using its reference:

dynamic_table_reference.refresh()

refresh_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of refresh().

Refer to PollingOperation for more information on asynchronous execution and the return type.

resume(if_exists: bool | None = None) → None

Resume the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before resuming it. Default is None, which is equivalent to False.

Examples

Resuming a dynamic table using its reference:

dynamic_table_reference.resume()

resume_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of resume().

Refer to PollingOperation for more information on asynchronous execution and the return type.

resume_recluster(if_exists: bool | None = None) → None

Enable reclustering the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before resuming its recluster. Default is None, which is equivalent to False.

Examples

Enable reclustering a dynamic table using its reference:

dynamic_table_reference.resume_recluster()

resume_recluster_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of resume_recluster().

Refer to PollingOperation for more information on asynchronous execution and the return type.

suspend(if_exists: bool | None = None) → None

Suspend the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before suspending it. Default is None, which is equivalent to False.

Examples

Suspending a dynamic table using its reference:

dynamic_table_reference.suspend()

suspend_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of suspend().

Refer to PollingOperation for more information on asynchronous execution and the return type.

suspend_recluster(if_exists: bool | None = None) → None

Disable reclustering the dynamic table.

Parameters:

if_exists (bool , optional) – Check the existence of this dynamic table before suspending its recluster. Default is None, which is equivalent to False.

Examples

Disable reclustering a dynamic table using its reference:

dynamic_table_reference.suspend_recluster()

suspend_recluster_async(if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of suspend_recluster().

Refer to PollingOperation for more information on asynchronous execution and the return type.

swap_with(to_swap_table_name: str, if_exists: bool | None = None) → None

Swap the name with another dynamic table.

Parameters:

Examples

Swaping name with another dynamic table using its reference:

dynamic_table_reference.swap_with("my_other_dynamic_table")

swap_with_async(to_swap_table_name: str, if_exists: bool | None = None) → PollingOperation[None]

An asynchronous version of swap_with().

Refer to PollingOperation for more information on asynchronous execution and the return type.

undelete() → None

The undelete method is deprecated; use undrop instead.

undrop() → None

Undrop the previously dropped dynamic table.

Examples

Reverting delete a dynamic table using its reference:

dynamic_table_reference.undrop()

undrop_async() → PollingOperation[None]

An asynchronous version of undrop().

Refer to PollingOperation for more information on asynchronous execution and the return type.