

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 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/)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# STL\_S3CLIENT\_ERROR
<a name="r_STL_S3CLIENT_ERROR"></a>

記錄從 Amazon S3 載入檔案時配量遇到的錯誤。

使用 STL\_S3CLIENT\_ERROR 來尋找從 Amazon S3 傳輸資料時所遇到之錯誤的詳細資訊，做為 COPY 命令的一部分。

所有使用者都可看見 STL\_S3CLIENT\_ERROR。超級使用者可以看見所有資料列；一般使用者只能看見自己的資料。如需詳細資訊，請參閱[系統資料表和檢視中資料的可見性](cm_chap_system-tables.md#c_visibility-of-data)。

## 資料表欄
<a name="r_STL_S3CLIENT_ERROR-table-columns2"></a>


| 欄名稱  | 資料類型  | 說明  | 
| --- | --- | --- | 
| userid | integer | 產生項目的使用者之 ID。 | 
| query  | integer | 查詢 ID。查詢欄可用於加入其他系統表格與檢視。查詢 ID -1 供內部使用。 | 
| sliceid | integer | 識別執行查詢之配量的數字。 | 
| recordtime  | timestamp | 記錄被記錄的時間。 | 
| pid  | integer  | 處理程序 ID。工作階段中的所有查詢都是在相同的處理程序中執行，所以若您在相同的工作階段中執行一系列查詢，則此值通常會保持不變。 | 
| http\_method  | character(64)  | 對應至 Amazon S3 請求的 HTTP 方法名稱。 | 
| 儲存貯體  | character(64)  | Amazon S3 儲存貯體名稱。 | 
| 金鑰  | character(256)  | 對應至 Amazon S3 物件的索引鍵。 | 
| error | character(1024) | 錯誤訊息。 | 
| is\_partial | integer | 如果值為 true (1)，則表示輸入檔在 COPY 操作期間被分割為多個範圍。如果此值為 false (0)，則輸入檔案不會分割。 | 
| start\_offset | bigint | 如果輸入檔案在 COPY 操作期間被分割，則該值指示分割的偏移值 (以位元組為單位)。如果檔案未分割，則此值為 0。 | 

## 使用須知
<a name="w2aac59c29b9c97c11"></a>

如果看到多個錯誤具有「連線逾時」，則可能發生聯網問題。如果您使用的是增強型 VPC 路由，請驗證您在叢集 VPC 與資料來源之間具有一個有效的網路路徑。如需詳細資訊，請參閱 [Amazon Redshift 增強型 VPC 路由](https://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html)。

## 範例查詢
<a name="w2aac59c29b9c97c13"></a>

下列查詢會從目前工作階段期間完成的 COPY 命令傳回錯誤。

```
select query, sliceid, substring(key from 1 for 20) as file, 
substring(error from 1 for 35) as error  
from stl_s3client_error 
where pid = pg_backend_pid()
order by query desc;
```

結果

```
 query  | sliceid |     file           |              error                             
--------+---------+--------------------+------------------------------------
 362228 |      12 | part.tbl.25.159.gz | transfer closed with 1947655 bytes 
 362228 |      24 | part.tbl.15.577.gz | transfer closed with 1881910 bytes 
 362228 |       7 | part.tbl.22.600.gz | transfer closed with 700143 bytes r 
 362228 |      22 | part.tbl.3.34.gz   | transfer closed with 2334528 bytes 
 362228 |      11 | part.tbl.30.274.gz | transfer closed with 699031 bytes r
 362228 |      30 | part.tbl.5.509.gz  | Unknown SSL protocol error in conne
 361999 |      10 | part.tbl.23.305.gz | transfer closed with 698959 bytes r
 361999 |      19 | part.tbl.26.582.gz | transfer closed with 1881458 bytes 
 361999 |       4 | part.tbl.15.629.gz | transfer closed with 2275907 bytes 
 361999 |      20 | part.tbl.6.456.gz  | transfer closed with 692162 bytes r
(10 rows)
```