du.study기록공간

Presto : Number of stages in the query (number) exceeds the allowed maximum (100). 본문

presto

Presto : Number of stages in the query (number) exceeds the allowed maximum (100).

du.study 2020. 2. 21. 00:43
728x90

현재 상용 서비스를 가시화 하기 위해 지표시스템을 구성하는 과정에서 저희팀은 Presto를 사용중에 있습니다.

그 이유로는

1. JDBC 지원

2. hive, mysql, mongo connector지원

3. RDB와 NOSQL의 조인기능 제공 

등으로 인해 현재 프레스토를 통하여 여러 DB의 데이터를 조회중입니다.

 

 

이 과정에서 쿼리를 날리는 도중 의문의 응답이 발생하게 되어 이번에 적어볼까 합니다.

 

현재 하이브 커넥터를 붙여 조회를 하는도중 다음과같은 에러가 발생하였습니다.

Query 20200219_085308_09698_afeh8 failed: Number of stages in the query (133) exceeds the allowed maximum (100). If the query contains multiple DISTINCTs, please set the use_mark_distinct session property to false. If the query contains multiple CTEs that are refe
renced more than once, please create temporary table(s) for one or more of the CTEs.

 

음 Stage가 넘었다라고 에러를 뱉고있는데 presto는 한개의 쿼리를 실행을 하게되면 내부적으로 여러 Operator들이 실행되는데 이 Operator가 모여서 Task라는 그룹이되고 이 Task 여러개가 한개의 Stage를 이루게 됩니다.

즉 Stage 가 100개를 넘었다면... 매우 많은 Operator를 실행했다는 소리가 됩니다.( 대체 어떻게 100개의 스테이지를 넘은건지....)

 

우선 임시 해결방법으로 config.properties 값에 추가 설정을 하여 조회이슈를 수정했습니다.

query.max-stage-count=150

 

 

음 하지만.. 근본적으로 쿼리 자체를 튜닝해야겠습니다. (대체 어떻게 100개를 넘었지..)

 

 

참고 자료:

https://prestosql.io/docs/current/release/release-0.208.html

728x90
Comments