

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# SYS\_UNLOAD\_HISTORY
<a name="SYS_UNLOAD_HISTORY"></a>

SYS\_UNLOAD\_HISTORY では、UNLOAD コマンドの詳細を表示します。いくつかのフィールドの累積統計情報を含む UNLOAD コマンドが、それぞれの行に対応し表示されます。この情報には、実行中および終了した UNLOAD コマンドの両方が含まれます。

SYS\_UNLOAD\_HISTORY はすべてのユーザーが表示可能です。スーパーユーザーはすべての行を表示できますが、通常のユーザーは自分のデータのみを表示できます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

## テーブルの列
<a name="SYS_UNLOAD_HISTORY-table-columns"></a>


| 列名  | データ型  | 説明  | 
| --- | --- | --- | 
| user\_id | integer | アンロードを送信したユーザーの識別子。 | 
| query\_id | bigint | UNLOAD コマンドのクエリ識別子。 | 
| transaction\_id | bigint | トランザクション識別子。 | 
| session\_id | integer | アンロードを実行しているプロセスのプロセス識別子。 | 
| database\_name | テキスト | 対象のオペレーションが発行された時点で、ユーザーが接続されていたデータベースの名前。 | 
| ステータス | テキスト | UNLOAD コマンドのステータス。有効な値は、running、completed、aborted、および unknown です。 | 
| start\_time | timestamp | アンロードが開始した時刻。 | 
| end\_time | timestamp | アンロードが完了した時刻。 | 
| duration | bigint | UNLOAD コマンド中に消費された時間 (マイクロ秒)。 | 
| file\_format | テキスト | 出力ファイルのファイル形式。 | 
| compression\_type | テキスト | 圧縮タイプ | 
| unloaded\_location | テキスト | アンロードされたファイル用の Amazon S3 の場所。 | 
| unloaded\_rows | bigint  | 行の数。 | 
| unloaded\_files\_count | bigint | 出力ファイルとして数えられるファイルの数。 | 
| unloaded\_files\_size | bigint | 出力ファイルのファイルサイズ。 | 
| error\_message | テキスト | UNLOAD コマンドのエラーメッセージ。 | 

## サンプルクエリ
<a name="SYS_UNLOAD_HISTORY-sample-queries"></a>

次のクエリは、アンロードコマンドの形式、行、ファイル数を含め、アンロードされたクエリの詳細を表示します。

```
SELECT query_id,
       file_format,
       start_time,
       duration,
       unloaded_rows,
       unloaded_files_count
FROM sys_unload_history
ORDER BY query_id,
file_format limit 100;
```

サンプル出力。

```
 query_id | file_format |         start_time         | duration | unloaded_rows | unloaded_files_count
----------+-------------+----------------------------+----------+---------------+----------------------
   527067 | Text        | 2022-02-09 05:18:35.844452 |  5932478 |            10 |                    1
```