

 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/)을 참조하세요.

# STL\$1LOAD\$1ERRORS
<a name="r_STL_LOAD_ERRORS"></a>

모든 Amazon Redshift 로드 오류에 대한 레코드를 표시합니다.

STL\$1LOAD\$1ERRORS에는 모든 Amazon Redshift 로드 오류에 대한 이력이 저장됩니다. 가능한 로드 오류와 설명을 나타낸 전체 목록은 [로드 오류 참조](r_Load_Error_Reference.md) 섹션을 참조하세요.

구문 분석 오류가 발생한 경우 STL\$1LOAD\$1ERRORS에 대한 쿼리를 실행하여 오류에 대한 일반 정보를 확인한 이후에도 정확한 데이터 행과 열 등을 포함하여 그 밖의 세부 정보를 알고 싶다면 [STL\$1LOADERROR\$1DETAIL](r_STL_LOADERROR_DETAIL.md)에 대한 쿼리를 실행합니다.

STL\$1LOAD\$1ERRORS는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

**참고**  
STL\$1LOAD\$1ERRORS에는 기본 프로비저닝된 클러스터에서 실행되는 쿼리만 포함됩니다. 동시성 크기 조정 클러스터 또는 서버리스 네임스페이스에서 실행되는 쿼리는 포함되지 않습니다. 기본 클러스터, 동시성 크기 조정 클러스터, 서버리스 네임스페이스 모두에서 실행되는 쿼리에 대한 설명 계획에 액세스하려면 SYS 모니터링 뷰인 [SYS\$1LOAD\$1ERROR\$1DETAIL](SYS_LOAD_ERROR_DETAIL.md)을 사용하는 것이 좋습니다. SYS 모니터링 뷰의 데이터는 사용 및 이해가 더 쉽도록 형식이 지정되어 있습니다.

## 테이블 열
<a name="r_STL_LOAD_ERRORS-table-columns2"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_STL_LOAD_ERRORS.html)

## 샘플 쿼리
<a name="r_STL_LOAD_ERRORS-sample-queries2"></a>

다음은 STL\$1LOAD\$1ERRORS를 STL\$1LOADERROR\$1DETAIL로 조인하여 가장 최근 로드 도중 발생한 오류 정보를 표시하는 쿼리입니다.

```
select d.query, substring(d.filename,14,20), 
d.line_number as line, 
substring(d.value,1,16) as value,
substring(le.err_reason,1,48) as err_reason
from stl_loaderror_detail d, stl_load_errors le
where d.query = le.query
and d.query = pg_last_copy_id(); 

 query |    substring      | line |  value   |              err_reason
-------+-------------------+------+----------+----------------------------
    558| allusers_pipe.txt |  251 | 251      | String contains invalid or 
                                               unsupported UTF8 code
    558| allusers_pipe.txt |  251 | ZRU29FGR | String contains invalid or 
                                               unsupported UTF8 code
    558| allusers_pipe.txt |  251 | Kaitlin  | String contains invalid or 
                                               unsupported UTF8 code
    558| allusers_pipe.txt |  251 | Walter   | String contains invalid or 
                                               unsupported UTF8 code
```

다음은 STL\$1LOAD\$1ERRORS와 STV\$1TBL\$1PERM을 함께 사용하여 새로운 뷰를 생성한 다음 이 뷰에서 EVENT 테이블로 데이터를 로드할 때 발생한 오류를 확인하는 예입니다.

```
create view loadview as
(select distinct tbl, trim(name) as table_name, query, starttime,
trim(filename) as input, line_number, colname, err_code,
trim(err_reason) as reason
from stl_load_errors sl, stv_tbl_perm sp
where sl.tbl = sp.id);
```

다음은 EVENT 테이블에 로드하는 도중 마지막으로 발생한 오류를 실제로 반환하는 쿼리입니다.

```
select table_name, query, line_number, colname, starttime, 
trim(reason) as error
from loadview
where table_name ='event'
order by line_number limit 1;
```

위 쿼리는 EVENT 테이블에서 발생한 마지막 로드 오류를 반환합니다. 발생한 로드 오류가 없는 경우에는 쿼리가 0개의 행을 반환합니다. 이번 예에서는 쿼리가 단일 오류를 반환합니다.

```
 table_name | query | line_number | colname | error | starttime
------+-----+----+----+--------------------------------------------------------+----------------------
event | 309 |  0 |  5 | Error in Timestamp value or format [%Y-%m-%d %H:%M:%S] | 2014-04-22 15:12:44

(1 row)
```

 병렬 처리를 용이하게 하기 위해 COPY 명령이 압축되지 않은 텍스트로 구분된 큰 파일 데이터를 자동으로 분할하는 경우 *line\$1number*, *is\$1partial* 및 *start\$1offset* 열은 분할과 관련된 정보를 표시합니다. (원본 파일의 줄 번호가 없을 경우 줄 번호를 알 수 없습니다.) 

```
--scan ranges information
SELECT line_number, POSITION, btrim(raw_line), btrim(raw_field_value),
btrim(err_reason), is_partial, start_offset FROM stl_load_errors
WHERE query = pg_last_copy_id();

--result
-1,51,"1008771|13463413|463414|2|28.00|38520.72|0.06|0.07|NO|1998-08-30|1998-09-25|1998-09-04|TAKE BACK RETURN|RAIL|ans cajole sly","NO","Char length exceeds DDL length",1,67108864
```