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
10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 | |