GERİ YÜKLEME

Şunlar için geçerlidir:onay işareti evet olarak işaretlenmiş Databricks SQL onay işareti evet olarak işaretlenmiş Databricks Runtime

Delta tablosunu önceki bir duruma geri yükler. Önceki bir sürüm numarasına veya zaman damgasına geri yükleme desteklenir.

Bu sayfa, komutuyla RESTORE doğru söz dizimini kullanmanın ayrıntılarını içerir. Bu komutla Delta Lake tablo sürümlerinde gezinme hakkında daha fazla kılavuz için bkz . Delta Lake tablo geçmişiyle çalışma.

Sözdizimi

RESTORE [ TABLE ] table_name [ TO ] time_travel_version

time_travel_version
 { TIMESTAMP AS OF timestamp_expression |
   VERSION AS OF version }

Parametreler

  • Table_name

    Geri yüklenecek Delta tablosunu tanımlar. Tablo adı zamansal belirtim kullanmamalıdır.

  • timestamp_expression şu türlerden herhangi biri olabilir:

    • '2018-10-18T22:15:12.013Z', başka bir ifadeyle zaman damgasına atanabilen bir dizedir
    • cast('2018-10-18 13:36:32 CEST' as timestamp)
    • '2018-10-18', yani bir tarih dizesi
    • current_timestamp() - interval 12 hours
    • date_sub(current_date(), 1)
    • Zaman damgasına atanabilen veya atanabilen diğer tüm ifadeler
  • version , çıkışından elde edilebilen uzun bir değerdir DESCRIBE HISTORY table_spec.

Alt timestamp_expression sorgular da version olamaz.

Örnekler

-- Restore the employee table to a specific timestamp
> RESTORE TABLE employee TO TIMESTAMP AS OF '2022-08-02 00:00:00';
 table_size_after_restore num_of_files_after_restore num_removed_files num_restored_files removed_files_size restored_files_size
                      100                          3                 1                  0                574                   0

-- Restore the employee table to a specific version number retrieved from DESCRIBE HISTORY employee
> RESTORE TABLE employee TO VERSION AS OF 1;
 table_size_after_restore num_of_files_after_restore num_removed_files num_restored_files removed_files_size restored_files_size
                      100                          3                 1                  0                574                   0

-- Restore the employee table to the state it was in an hour ago
> RESTORE TABLE employee TO TIMESTAMP AS OF current_timestamp() - INTERVAL '1' HOUR;
 table_size_after_restore num_of_files_after_restore num_removed_files num_restored_files removed_files_size restored_files_size
                      100                          3                 1                  0                574                   0