restore_table_from_cluster_snapshot
¶
restore_table_from_cluster_snapshot(
*,
config_overrides: Optional[RedshiftClientConfig] = None,
cluster_identifier: Optional[String] = None,
snapshot_identifier: Optional[String] = None,
source_database_name: Optional[String] = None,
source_schema_name: Optional[String] = None,
source_table_name: Optional[String] = None,
target_database_name: Optional[String] = None,
target_schema_name: Optional[String] = None,
new_table_name: Optional[String] = None,
enable_case_sensitive_identifier: Optional[BooleanOptional] = None,
) -> RestoreTableFromClusterSnapshotResult
Creates a new table from a table in an Amazon Redshift cluster snapshot. You must create the new table within the Amazon Redshift cluster that the snapshot was taken from.
You cannot use RestoreTableFromClusterSnapshot to restore a table with the same name as an existing table in an Amazon Redshift cluster. That is, you cannot overwrite an existing table in a cluster with a restored table. If you want to replace your original table with a new, restored table, then rename or drop your original table before you call RestoreTableFromClusterSnapshot. When you have renamed your original table, then you can pass the original name of the table as the NewTableName parameter value in the call to RestoreTableFromClusterSnapshot. This way, you can replace the original table with the table created from the snapshot.
You can't use this operation to restore tables with interleaved sort keys.
Parameters:
-
cluster_identifier(Optional[String], default:None) –The identifier of the Amazon Redshift cluster to restore the table to.
-
snapshot_identifier(Optional[String], default:None) –The identifier of the snapshot to restore the table from. This snapshot must have been created from the Amazon Redshift cluster specified by the
ClusterIdentifierparameter. -
source_database_name(Optional[String], default:None) –The name of the source database that contains the table to restore from.
-
source_schema_name(Optional[String], default:None) –The name of the source schema that contains the table to restore from. If you do not specify a
SourceSchemaNamevalue, the default ispublic. -
source_table_name(Optional[String], default:None) –The name of the source table to restore from.
-
target_database_name(Optional[String], default:None) –The name of the database to restore the table to.
-
target_schema_name(Optional[String], default:None) –The name of the schema to restore the table to.
-
new_table_name(Optional[String], default:None) –The name of the table to create as a result of the current request.
-
enable_case_sensitive_identifier(Optional[BooleanOptional], default:None) –Indicates whether name identifiers for database, schema, and table are case sensitive. If
true, the names are case sensitive. Iffalse(default), the names are not case sensitive.
Raises:
-
ClusterNotFoundFault–The
ClusterIdentifierparameter does not refer to an existing cluster. -
ClusterSnapshotNotFoundFault–The snapshot identifier does not refer to an existing cluster snapshot.
-
InProgressTableRestoreQuotaExceededFault–You have exceeded the allowed number of table restore requests. Wait for your current table restore requests to complete before making a new request.
-
InvalidClusterSnapshotStateFault–The specified cluster snapshot is not in the
availablestate, or other accounts are authorized to access the snapshot. -
InvalidClusterStateFault–The specified cluster is not in the
availablestate. -
InvalidTableRestoreArgumentFault–The value specified for the
sourceDatabaseName,sourceSchemaName, orsourceTableNameparameter, or a combination of these, doesn't exist in the snapshot. -
UnsupportedOperationFault–The requested operation isn't supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift/_services/redshift.py
10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 | |