snowflake.core.dynamic_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
fully_qualified_name
root

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()
Copy
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)
Copy
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()
Copy
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()
Copy
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()
Copy
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()
Copy
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()
Copy
swap_with(to_swap_table_name: str, if_exists: bool | None = None) None

Swap the name with another dynamic table.

Parameters:
  • to_swap_table_name (str) – The name of the table to swap with.

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

Examples

Swaping name with another dynamic table using its reference:

>>> dynamic_table_reference.swap_with("my_other_dynamic_table")
Copy
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()
Copy
Language: English