Druid SQL API

Druid SQL API

Druid SQL 기반 쿼리를 제출하는 API 엔드포인트를 다룹니다. JSON·텍스트 요청 형식, 쿼리 취소, 그리고 딥 스토리지(deep storage) 쿼리까지 설명해요.

출처: 문서

본문

참고: Apache Druid는 두 가지 쿼리 언어를 지원합니다. Druid SQL과 **네이티브 쿼리(native queries)**예요. 이 문서는 SQL 언어를 설명합니다.

이 문서에서 http://ROUTER_IP:ROUTER_PORT는 여러분의 Router 서비스 주소와 포트를 위한 자리표시자입니다. 이를 배포 정보로 교체하세요. 예를 들어 quickstart 배포라면 http://localhost:8888을 사용합니다.

Historical에서 쿼리

쿼리 제출

JSON 또는 텍스트 형식의 요청 본문으로 SQL 기반 쿼리를 제출합니다. 쿼리 결과와 메타데이터(선택)가 담긴 JSON 객체를 반환합니다. 이 엔드포인트로 메타데이터 테이블도 쿼리할 수 있어요.

각 쿼리에는 연결된 SQL 쿼리 ID가 있습니다. 이 ID는 SQL 컨텍스트 파라미터 sqlQueryId로 직접 설정할 수 있어요. 설정하지 않으면 Druid가 자동으로 sqlQueryId를 생성하고 응답 헤더 X-Druid-SQL-Query-Id로 반환합니다. 쿼리를 취소하려면 sqlQueryId가 필요함을 유의하세요.

URL

POST /druid/v2/sql

JSON 형식 요청 본문

JSON 형식으로 쿼리를 보내려면 HTTP 요청의 Content-Type이 반드시 application/json이어야 합니다. Content-Type 헤더가 여러 개면 첫 번째 것을 사용합니다.

요청 본문은 다음 속성을 받습니다.

  • query: SQL 쿼리 문자열. HTTP 요청에는 쿼리 문에 적용할 SQL 쿼리 컨텍스트 파라미터 값을 할당하는 여러 SET 문을 포함할 수 있어요. 자세한 내용은 SET을 참고하세요. SET 문으로 설정한 컨텍스트 파라미터가 context에 설정된 값보다 우선합니다.
  • resultFormat: 쿼리 결과를 반환할 형식을 나타내는 문자열. 다음 형식 중 하나를 선택하세요.
    • object: HTTP 응답 헤더 Content-Type: application/json으로 JSON 객체의 JSON 배열을 반환합니다. 객체의 필드 이름은 SQL 쿼리가 반환하는 컬럼을 SQL 쿼리와 같은 순서로 매칭합니다.
    • array: HTTP 응답 헤더 Content-Type: application/json으로 JSON 배열의 JSON 배열을 반환합니다. 각 내부 배열은 SQL 쿼리가 반환하는 컬럼을 순서대로 요소로 가집니다.
    • objectLines: HTTP 응답 헤더 Content-Type: text/plain으로 개행 구분된 JSON 객체를 반환합니다. 개행 구분을 사용하면 스트리밍 JSON 파서가 없어도 전체 응답 집합을 스트림으로 파싱하기 쉽습니다. 이 형식은 잘린 응답을 감지할 수 있도록 단일 후행 개행 문자를 포함합니다.
    • arrayLines: HTTP 응답 헤더 Content-Type: text/plain으로 개행 구분된 JSON 배열을 반환합니다. 개행 구분을 사용하면 스트리밍 JSON 파서가 없어도 전체 응답 집합을 스트림으로 파싱하기 쉽습니다. 이 형식은 잘린 응답을 감지할 수 있도록 단일 후행 개행 문자를 포함합니다.
    • csv: HTTP 응답 헤더 Content-Type: text/csv으로 행별 한 줄씩 콤마 구분 값을 반환합니다. Druid는 개별 필드 값을 이스케이프할 때 큰따옴표(double quote)를 사용합니다. 예를 들어 콤마가 있는 값은 "A,B"로 반환됩니다. 필드 값에 큰따옴표 문자가 포함되면 Druid는 두 번째 큰따옴표로 이스케이프합니다. 예를 들어 foo"bar는 foo""bar가 됩니다. 이 형식은 잘린 응답을 감지할 수 있도록 단일 후행 개행 문자를 포함합니다.
  • header: 컬럼 이름 정보를 반환할지 결정하는 Boolean 값. true로 설정하면 Druid가 컬럼 이름을 결과의 첫 번째 행으로 반환합니다. 컬럼 타입 정보도 얻으려면 typesHeader나 sqlTypesHeader를 true로 설정하세요. 데이터 형식과 header 구성의 비교 개요는 Query output format 표를 참고하세요.
  • typesHeader: 헤더에 Druid 런타임 타입 정보를 추가합니다. header가 true로 설정되어 있어야 합니다. sketch 같은 복합(complex) 타입은 해당 필드에 특정 복합 타입 이름이 알려져 있으면 COMPLEX<typeName>으로, 특정 타입 이름이 알려져 있지 않거나 혼합되어 있으면 COMPLEX로 보고됩니다.
  • sqlTypesHeader: 헤더에 SQL 타입 정보를 추가합니다. header가 true로 설정되어 있어야 합니다.
  • 호환성을 위해 Druid는 다음 조건이 모두 충족되면 HTTP 헤더 X-Druid-SQL-Header-Included: yes를 반환합니다.
    • header 속성이 true로 설정됨
    • Druid 버전이 두 속성 중 하나가 설정되었는지와 무관하게 typesHeader와 sqlTypesHeader를 지원함
  • context: 쿼리 ID 설정, 시간대 설정, distinct count에 근사 알고리즘 사용 여부 같은 선택적 SQL 쿼리 컨텍스트 파라미터를 담은 JSON 객체. 컨텍스트는 SQL SET 명령으로도 설정할 수 있어요. 자세한 내용은 Druid SQL overview를 참고하세요.
  • parameters: 파라미터화된 쿼리(parameterized query)용 쿼리 파라미터 목록. 배열의 각 파라미터는 파라미터의 SQL 데이터 타입과 값을 담은 JSON 객체여야 합니다. 동적 파라미터 사용에 대한 자세한 내용은 Dynamic parameters를 참고하세요. 지원되는 SQL 타입 목록은 Data types를 참고하세요.

예를 들어:

{
    "query": "SELECT \"arrayDouble\", \"stringColumn\" FROM \"array_example\" WHERE ARRAY_CONTAINS(\"arrayDouble\", ?) AND \"stringColumn\" = ?",
    "parameters": [
        {"type": "ARRAY", "value": [999.0, null, 5.5]},
        {"type": "VARCHAR", "value": "bar"}
        ]
}
텍스트 형식 요청 본문

Druid는 위 JSON 형식보다 더 간단한 텍스트 형식으로 SQL 쿼리를 제출하는 것도 허용합니다. 그러려면 Content-Type 요청 헤더를 text/plain이나 application/x-www-form-urlencoded로 설정하고 HTTP Body로 SQL을 전달하면 됩니다.

application/x-www-form-urlencoded를 사용하면 SQL 쿼리가 URL 인코딩되어 있는지 확인하세요.

Content-Type 헤더가 여러 개면 첫 번째 것을 사용합니다.

응답의 경우 resultFormat은 항상 HTTP 응답 헤더 Content-Type: application/json을 가진 object입니다. 쿼리 컨텍스트나 응답 형식을 더 제어하고 싶다면 위의 JSON 형식 요청 본문을 대신 사용하세요.

다음 예시는 텍스트 형식으로 SQL 쿼리를 제출하는 방법을 보여줍니다.

echo 'SELECT 1' | curl -H 'Content-Type: text/plain' http://ROUTER_IP:ROUTER_PORT/druid/v2/sql --data @- 

URL 인코딩된 SQL 쿼리를 제출하려면 application/x-www-form-urlencoded를 사용할 수도 있습니다. 다음 예시를 참고하세요.

echo 'SELECT%20%31' | curl http://ROUTER_IP:ROUTER_PORT/druid/v2/sql --data @-
echo 'SELECT 1' | curl http://ROUTER_IP:ROUTER_PORT/druid/v2/sql --data-urlencode @-

curl 도구는 헤더가 주어지지 않으면 Content-Type 헤더로 application/x-www-form-urlencoded를 사용합니다.

첫 번째 예시는 URL 인코딩된 쿼리 SELECT%20%31(즉, SELECT 1)을 curl에 전달하고, curl이 그대로 서버에 보냅니다. 반면 두 번째 예시는 원시 쿼리 SELECT 1을 curl에 전달하고, --data-urlencode 옵션 때문에 curl이 쿼리를 SELECT%20%31로 인코딩해 서버에 보냅니다.

응답
  • 200 SUCCESS — 쿼리를 성공적으로 제출함
  • 400 BAD REQUEST — 잘못된 쿼리로 인한 오류. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "A well-defined error code.",
    "errorMessage": "A message with additional details about the error.",
    "errorClass": "Class of exception that caused this error.",
    "host": "The host on which the error occurred."
}
  • 500 INTERNAL SERVER ERROR — 예상치 못한 조건으로 요청이 전송되지 않음. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "A well-defined error code.",
    "errorMessage": "A message with additional details about the error.",
    "errorClass": "Class of exception that caused this error.",
    "host": "The host on which the error occurred."
}
클라이언트 측 오류 처리와 잘린 응답

Druid는 응답 본문이 전송되기 전에 발생한 오류를 HTTP 500 상태 코드의 JSON으로 보고합니다. 오류는 네이티브 Druid 쿼리 오류와 같은 형식으로 보고됩니다. Druid가 응답 본문을 보내는 중에 오류가 발생하면, 요청을 처리하는 서버가 응답을 중단하고 오류를 기록합니다.

즉 SQL API를 호출할 때는 응답 잘림(response truncation)을 적절히 처리해야 합니다. object 및 array 형식의 경우 잘린 응답은 유효하지 않은 JSON입니다. 줄 단위(line-oriented) 형식의 경우 Druid는 모든 완전한 응답의 마지막 문자로 새줄 문자를 포함합니다. 마지막 새줄 문자가 없으면 잘린 응답을 나타냅니다.

잘린 응답을 감지하면 오류로 취급하세요.

샘플 요청

다음 예시 쿼리는 다음 동작을 보여줍니다.

  • wikipedia 데이터소스의 모든 행을 가져옵니다.
  • user 값이 BlueMoon2662인 결과로 필터링합니다.
  • sqlTimeZone 컨텍스트 파라미터를 적용해 결과의 시간대를 America/Los_Angeles로 설정합니다.
  • header, typesHeader, sqlTypesHeader에 대한 설명자(descriptor)를 반환합니다.

cURL

curl "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql" \
--header 'Content-Type: application/json' \
--data '{
    "query": "SELECT * FROM wikipedia WHERE user='\''BlueMoon2662'\''",
    "context" : {"sqlTimeZone" : "America/Los_Angeles"},
    "header" : true,
    "typesHeader" : true,
    "sqlTypesHeader" : true
}'

HTTP

POST /druid/v2/sql HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
Content-Type: application/json
Content-Length: 201

{
    "query": "SELECT * FROM wikipedia WHERE user='BlueMoon2662'",
    "context" : {"sqlTimeZone" : "America/Los_Angeles"},
    "header" : true,
    "typesHeader" : true,
    "sqlTypesHeader" : true
}

SQL 쿼리 문자열 안에서 SET 명령을 사용해 쿼리 레벨 컨텍스트 파라미터를 직접 지정할 수도 있습니다. 자세한 내용은 SET을 참고하세요.

다음 요청 본문은 이전 예시와 기능적으로 동일하며 context 파라미터 대신 SET을 사용합니다.

{
  "query": "SET sqlTimeZone='America/Los_Angeles'; SELECT * FROM wikipedia WHERE user='BlueMoon2662'",
  "header": true,
  "typesHeader": true,
  "sqlTypesHeader": true
}
샘플 응답
[
    {
        "__time": {
            "type": "LONG",
            "sqlType": "TIMESTAMP"
        },
        "channel": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "cityName": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "comment": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "countryIsoCode": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "countryName": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "isAnonymous": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "isMinor": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "isNew": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "isRobot": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "isUnpatrolled": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "metroCode": {
            "type": "LONG",
            "sqlType": "BIGINT"
        },
        "namespace": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "page": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "regionIsoCode": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "regionName": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "user": {
            "type": "STRING",
            "sqlType": "VARCHAR"
        },
        "delta": {
            "type": "LONG",
            "sqlType": "BIGINT"
        },
        "added": {
            "type": "LONG",
            "sqlType": "BIGINT"
        },
        "deleted": {
            "type": "LONG",
            "sqlType": "BIGINT"
        }
    },
    {
        "__time": "2015-09-11T17:47:53.259-07:00",
        "channel": "#ja.wikipedia",
        "cityName": null,
        "comment": "/* 対戦通算成績と得失点 */",
        "countryIsoCode": null,
        "countryName": null,
        "isAnonymous": "false",
        "isMinor": "true",
        "isNew": "false",
        "isRobot": "false",
        "isUnpatrolled": "false",
        "metroCode": null,
        "namespace": "Main",
        "page": "アルビレックス新潟の年度別成績一覧",
        "regionIsoCode": null,
        "regionName": null,
        "user": "BlueMoon2662",
        "delta": 14,
        "added": 14,
        "deleted": 0
    }
]

쿼리 취소

연결된 sqlQueryId로 Router나 Broker에서 쿼리를 취소합니다. sqlQueryId는 쿼리 제출 시 쿼리 컨텍스트 파라미터로 직접 설정할 수 있고, 설정하지 않으면 Druid가 생성해 쿼리가 성공적으로 제출될 때 응답 헤더로 반환합니다. 참고로 Druid는 쿼리 컨텍스트에서 고유한 sqlQueryId를 강제하지 않습니다. 여러 쿼리에 같은 sqlQueryId를 설정했다면 Druid는 그 쿼리 ID를 가진 모든 요청을 취소합니다.

쿼리를 취소하면 Druid는 최선 노력(best-effort) 방식으로 취소를 처리합니다. Druid는 쿼리를 즉시 취소됨으로 표시하고 가능한 빨리 쿼리 실행을 중단합니다. 다만 취소 요청 후에도 쿼리가 짧은 시간 동안 계속 실행될 수 있어요.

취소 요청에는 SQL 쿼리에 사용된 모든 리소스에 대한 READ 권한이 필요합니다.

URL

DELETE /druid/v2/sql/{sqlQueryId}

응답
  • 202 SUCCESS — 쿼리를 성공적으로 삭제함
  • 403 FORBIDDEN — 인증 실패
  • 404 NOT FOUND — 잘못된 sqlQueryId이거나 취소 요청 전에 쿼리가 완료됨
샘플 요청

다음 예시는 설정된 쿼리 ID request01의 요청을 취소합니다.

cURL

curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql/request01"

HTTP

DELETE /druid/v2/sql/request01 HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
샘플 응답

성공하면 HTTP 202 메시지 코드와 빈 응답 본문이 됩니다.

쿼리 출력 형식

다음 표는 결과 형식과 타입 요청에 따라 Druid가 컬럼 이름과 데이터 타입을 어떻게 반환하는지 예시를 보여줍니다. 모든 경우에 header는 true입니다. 예시에는 user 값이 BlueMoon2662인 결과의 첫 번째 행이 포함됩니다.

형식 typesHeader sqlTypesHeader 출력 예시
object true false [ { "user" : { "type" : "STRING" } }, { "user" : "BlueMoon2662" } ]
object true true [ { "user" : { "type" : "STRING", "sqlType" : "VARCHAR" } }, { "user" : "BlueMoon2662" } ]
object false true [ { "user" : { "sqlType" : "VARCHAR" } }, { "user" : "BlueMoon2662" } ]
object false false [ { "user" : null }, { "user" : "BlueMoon2662" } ]
array true false [ [ "user" ], [ "STRING" ], [ "BlueMoon2662" ] ]
array true true [ [ "user" ], [ "STRING" ], [ "VARCHAR" ], [ "BlueMoon2662" ] ]
array false true [ [ "user" ], [ "VARCHAR" ], [ "BlueMoon2662" ] ]
array false false [ [ "user" ], [ "BlueMoon2662" ] ]
csv true false user STRING BlueMoon2662
csv true true user STRING VARCHAR BlueMoon2662
csv false true user VARCHAR BlueMoon2662
csv false false user BlueMoon2662

딥 스토리지에서 쿼리

sql/statements 엔드포인트를 사용해 딥 스토리지에만 존재하고 로드 규칙에 따라 Historical 프로세스에 로드되지 않은 세그먼트를 쿼리할 수 있습니다.

데이터소스의 세그먼트 중 적어도 하나는 Broker가 쿼리를 계획할 수 있도록 Historical 프로세스에서 사용 가능해야 합니다. 이 사실을 확인하는 빠른 방법은 데이터소스가 Druid 콘솔에 보이는지 여부입니다.

자세한 내용은 Query from deep storage를 참고하세요.

쿼리 제출

딥 스토리지에 저장된 데이터에 대한 쿼리를 제출합니다. Druid에 수집된 모든 데이터는 딥 스토리지에 배치됩니다. 쿼리는 요청 페이로드의 JSON 객체 안 "query" 필드에 포함됩니다.

데이터소스의 적어도 일부는 Druid가 쿼리를 계획할 수 있도록 Historical 프로세스에서 사용 가능해야 하고, 쿼리를 제출한 사용자만 결과를 볼 수 있습니다.

URL

POST /druid/v2/sql/statements

요청 본문

일반적으로 sql과 sql/statements 엔드포인트는 약간의 차이를 제외하고 같은 응답 본문 필드를 지원합니다. 사용 가능한 필드에 대한 일반적인 정보는 sql 엔드포인트에 쿼리 제출을 참고하세요.

sql/statements 엔드포인트에 쿼리를 제출할 때는 다음을 염두에 두세요.

여기서 언급한 컨텍스트 파라미터 외에 sql/statements 전용 추가 컨텍스트 파라미터가 있습니다.

  • executionMode — 쿼리 결과를 가져오는 방식을 결정합니다. Druid는 현재 ASYNC만 지원합니다. 쿼리가 완료된 후 결과를 수동으로 가져와야 합니다.
  • selectDestination — 최종 결과가 기록되는 위치를 결정합니다. 기본적으로 결과는 태스크 보고서(task reports)에 기록됩니다. 이 파라미터를 durableStorage로 설정하면 Druid가 SELECT 쿼리의 결과를 내구성 스토리지(durable storage)에 쓰도록 지시해, 더 큰 결과 집합을 가져올 수 있게 해줍니다. 3000행 이상의 결과 집합에는 durableStorage를 사용하는 것이 좋습니다. 이 경우 MSQ용 내구성 스토리지가 활성화되어 있어야 합니다.
응답
  • 200 SUCCESS — 딥 스토리지에서 성공적으로 쿼리함
  • 400 BAD REQUEST — 잘못된 쿼리로 인한 오류. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "Summary of the encountered error.",
    "errorClass": "Class of exception that caused this error.",
    "host": "The host on which the error occurred.",
    "errorCode": "Well-defined error code.",
    "persona": "Role or persona associated with the error.",
    "category": "Classification of the error.",
    "errorMessage": "Summary of the encountered issue with expanded information.",
    "context": "Additional context about the error."
}
샘플 요청

cURL

curl "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql/statements" \
--header 'Content-Type: application/json' \
--data '{
    "query": "SELECT * FROM wikipedia WHERE user='\''BlueMoon2662'\''",
    "context": {
        "executionMode":"ASYNC"
    }
}'

HTTP

POST /druid/v2/sql/statements HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
Content-Type: application/json
Content-Length: 134

{
    "query": "SELECT * FROM wikipedia WHERE user='BlueMoon2662'",
    "context": {
        "executionMode":"ASYNC"
    }
}
샘플 응답
{
  "queryId": "query-b82a7049-b94f-41f2-a230-7fef94768745",
  "state": "ACCEPTED",
  "createdAt": "2023-07-26T21:16:25.324Z",
  "schema": [
      {
          "name": "__time",
          "type": "TIMESTAMP",
          "nativeType": "LONG"
      },
      {
          "name": "channel",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "cityName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "comment",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "countryIsoCode",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "countryName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "isAnonymous",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isMinor",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isNew",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isRobot",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isUnpatrolled",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "metroCode",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "namespace",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "page",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "regionIsoCode",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "regionName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "user",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "delta",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "added",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "deleted",
          "type": "BIGINT",
          "nativeType": "LONG"
      }
  ],
  "durationMs": -1
}

쿼리 상태 가져오기

주어진 쿼리 ID와 연결된 쿼리에 대한 정보를 가져옵니다. 쿼리가 수락되거나 실행 중이고 execution mode가 ASYNC라면 응답은 POST API의 응답과 일치합니다. 이 엔드포인트가 POST /sql/statements와 공유하는 필드 외에, 완료된 쿼리의 상태에는 다음이 포함됩니다.

  • 결과에 대한 총 행 수와 샘플 레코드 같은 정보를 요약하는 result 객체.
  • 각 결과 페이지에 대한 다음 정보를 포함하는 pages 객체:
    • numRows: 해당 결과 페이지의 행 수
    • sizeInBytes: 페이지 크기
    • id: 쿼리 결과를 가져올 때 특정 페이지를 참조하는 데 사용할 수 있는 페이지 번호

선택적 쿼리 파라미터 detail이 제공되면 응답에는 다음도 포함됩니다.

  • 쿼리 실행에 사용되는 서로 다른 스테이지에 대한 스테이지 번호, 단계(phase), 시작 시간, 기간, 입출력 정보, 처리 방법, 파티셔닝 같은 정보를 요약하는 stages 객체.
  • 각 채널에서 각 워커가 다양한 스테이지에서 처리한 행·바이트·파일과 정렬 진행 상황에 대한 세부 정보를 제공하는 counters 객체.
  • 경고에 대한 세부 정보를 제공하는 warnings 객체.
URL

GET /druid/v2/sql/statements/{queryId}

쿼리 파라미터
  • detail (선택) — 타입: Boolean. 기본값: false. 서로 다른 스테이지, 각 스테이지의 카운터, 경고에 대한 정보를 포함해 쿼리에 대한 추가 세부 정보를 가져옵니다.
응답
  • 200 SUCCESS — 쿼리 상태를 성공적으로 조회함
  • 400 BAD REQUEST — 잘못된 쿼리로 인한 오류. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "Summary of the encountered error.",
    "errorCode": "Well-defined error code.",
    "persona": "Role or persona associated with the error.",
    "category": "Classification of the error.",
    "errorMessage": "Summary of the encountered issue with expanded information.",
    "context": "Additional context about the error."
}
샘플 요청

다음 예시는 지정된 ID query-9b93f6f7-ab0e-48f5-986a-3520f84f0804의 쿼리 상태를 조회합니다.

cURL

curl "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql/statements/query-9b93f6f7-ab0e-48f5-986a-3520f84f0804?detail=true"

HTTP

GET /druid/v2/sql/statements/query-9b93f6f7-ab0e-48f5-986a-3520f84f0804?detail=true HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
샘플 응답
{
  "queryId": "query-9b93f6f7-ab0e-48f5-986a-3520f84f0804",
  "state": "SUCCESS",
  "createdAt": "2023-07-26T22:57:46.620Z",
  "schema": [
      {
          "name": "__time",
          "type": "TIMESTAMP",
          "nativeType": "LONG"
      },
      {
          "name": "channel",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "cityName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "comment",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "countryIsoCode",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "countryName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "isAnonymous",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isMinor",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isNew",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isRobot",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "isUnpatrolled",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "metroCode",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "namespace",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "page",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "regionIsoCode",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "regionName",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "user",
          "type": "VARCHAR",
          "nativeType": "STRING"
      },
      {
          "name": "delta",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "added",
          "type": "BIGINT",
          "nativeType": "LONG"
      },
      {
          "name": "deleted",
          "type": "BIGINT",
          "nativeType": "LONG"
      }
  ],
  "durationMs": 25591,
  "result": {
      "numTotalRows": 1,
      "totalSizeInBytes": 375,
      "dataSource": "__query_select",
      "sampleRecords": [
          [
              1442018873259,
              "#ja.wikipedia",
              "",
              "/* 対戦通算成績と得失点 */",
              "",
              "",
              0,
              1,
              0,
              0,
              0,
              0,
              "Main",
              "アルビレックス新潟の年度別成績一覧",
              "",
              "",
              "BlueMoon2662",
              14,
              14,
              0
          ]
      ],
      "pages": [
          {
              "id": 0,
              "numRows": 1,
              "sizeInBytes": 375
          }
      ]
  },
  "stages": [
      {
          "stageNumber": 0,
          "definition": {
              "id": "query-9b93f6f7-ab0e-48f5-986a-3520f84f0804_0",
              "input": [
                  {
                      "type": "table",
                      "dataSource": "wikipedia",
                      "intervals": [
                          "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"
                      ]
                  }
              ],
              "processor": {
                  "type": "scan",
                  "query": {
                      "queryType": "scan",
                      "dataSource": {
                          "type": "inputNumber",
                          "inputNumber": 0
                      },
                      "intervals": {
                          "type": "intervals",
                          "intervals": [
                              "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"
                          ]
                      },
                      "virtualColumns": [
                          {
                              "type": "expression",
                              "name": "v0",
                              "expression": "'BlueMoon2662'",
                              "outputType": "STRING"
                          }
                      ],
                      "resultFormat": "compactedList",
                      "limit": 1001,
                      "filter": {
                          "type": "equals",
                          "column": "user",
                          "matchValueType": "STRING",
                          "matchValue": "BlueMoon2662"
                      },
                      "columns": [
                          "__time",
                          "added",
                          "channel",
                          "cityName",
                          "comment",
                          "commentLength",
                          "countryIsoCode",
                          "countryName",
                          "deleted",
                          "delta",
                          "deltaBucket",
                          "diffUrl",
                          "flags",
                          "isAnonymous",
                          "isMinor",
                          "isNew",
                          "isRobot",
                          "isUnpatrolled",
                          "metroCode",
                          "namespace",
                          "page",
                          "regionIsoCode",
                          "regionName",
                          "v0"
                      ],
                      "context": {
                          "__resultFormat": "array",
                          "__user": "allowAll",
                          "executionMode": "async",
                          "finalize": true,
                          "maxNumTasks": 2,
                          "maxParseExceptions": 0,
                          "queryId": "33b53acb-7533-4880-a81b-51c16c489eab",
                          "scanSignature": "[{\"name\":\"__time\",\"type\":\"LONG\"},{\"name\":\"added\",\"type\":\"LONG\"},{\"name\":\"channel\",\"type\":\"STRING\"},{\"name\":\"cityName\",\"type\":\"STRING\"},{\"name\":\"comment\",\"type\":\"STRING\"},{\"name\":\"commentLength\",\"type\":\"LONG\"},{\"name\":\"countryIsoCode\",\"type\":\"STRING\"},{\"name\":\"countryName\",\"type\":\"STRING\"},{\"name\":\"deleted\",\"type\":\"LONG\"},{\"name\":\"delta\",\"type\":\"LONG\"},{\"name\":\"deltaBucket\",\"type\":\"LONG\"},{\"name\":\"diffUrl\",\"type\":\"STRING\"},{\"name\":\"flags\",\"type\":\"STRING\"},{\"name\":\"isAnonymous\",\"type\":\"STRING\"},{\"name\":\"isMinor\",\"type\":\"STRING\"},{\"name\":\"isNew\",\"type\":\"STRING\"},{\"name\":\"isRobot\",\"type\":\"STRING\"},{\"name\":\"isUnpatrolled\",\"type\":\"STRING\"},{\"name\":\"metroCode\",\"type\":\"STRING\"},{\"name\":\"namespace\",\"type\":\"STRING\"},{\"name\":\"page\",\"type\":\"STRING\"},{\"name\":\"regionIsoCode\",\"type\":\"STRING\"},{\"name\":\"regionName\",\"type\":\"STRING\"},{\"name\":\"v0\",\"type\":\"STRING\"}]",
                          "sqlOuterLimit": 1001,
                          "sqlQueryId": "33b53acb-7533-4880-a81b-51c16c489eab",
                          "sqlStringifyArrays": false
                      },
                      "columnTypes": [
                          "LONG",
                          "LONG",
                          "STRING",
                          "STRING",
                          "STRING",
                          "LONG",
                          "STRING",
                          "STRING",
                          "LONG",
                          "LONG",
                          "LONG",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING",
                          "STRING"
                      ],
                      "granularity": {
                          "type": "all"
                      },
                      "legacy": false
                  }
              },
              "signature": [
                  {
                      "name": "__boost",
                      "type": "LONG"
                  },
                  {
                      "name": "__time",
                      "type": "LONG"
                  },
                  {
                      "name": "added",
                      "type": "LONG"
                  },
                  {
                      "name": "channel",
                      "type": "STRING"
                  },
                  {
                      "name": "cityName",
                      "type": "STRING"
                  },
                  {
                      "name": "comment",
                      "type": "STRING"
                  },
                  {
                      "name": "commentLength",
                      "type": "LONG"
                  },
                  {
                      "name": "countryIsoCode",
                      "type": "STRING"
                  },
                  {
                      "name": "countryName",
                      "type": "STRING"
                  },
                  {
                      "name": "deleted",
                      "type": "LONG"
                  },
                  {
                      "name": "delta",
                      "type": "LONG"
                  },
                  {
                      "name": "deltaBucket",
                      "type": "LONG"
                  },
                  {
                      "name": "diffUrl",
                      "type": "STRING"
                  },
                  {
                      "name": "flags",
                      "type": "STRING"
                  },
                  {
                      "name": "isAnonymous",
                      "type": "STRING"
                  },
                  {
                      "name": "isMinor",
                      "type": "STRING"
                  },
                  {
                      "name": "isNew",
                      "type": "STRING"
                  },
                  {
                      "name": "isRobot",
                      "type": "STRING"
                  },
                  {
                      "name": "isUnpatrolled",
                      "type": "STRING"
                  },
                  {
                      "name": "metroCode",
                      "type": "STRING"
                  },
                  {
                      "name": "namespace",
                      "type": "STRING"
                  },
                  {
                      "name": "page",
                      "type": "STRING"
                  },
                  {
                      "name": "regionIsoCode",
                      "type": "STRING"
                  },
                  {
                      "name": "regionName",
                      "type": "STRING"
                  },
                  {
                      "name": "v0",
                      "type": "STRING"
                  }
              ],
              "shuffleSpec": {
                  "type": "mix"
              },
              "maxWorkerCount": 1
          },
          "phase": "FINISHED",
          "workerCount": 1,
          "partitionCount": 1,
          "shuffle": "mix",
          "output": "localStorage",
          "startTime": "2024-07-31T15:20:21.255Z",
          "duration": 103
      },
      {
          "stageNumber": 1,
          "definition": {
              "id": "query-9b93f6f7-ab0e-48f5-986a-3520f84f0804_1",
              "input": [
                  {
                      "type": "stage",
                      "stage": 0
                  }
              ],
              "processor": {
                  "type": "limit",
                  "limit": 1001
              },
              "signature": [
                  {
                      "name": "__boost",
                      "type": "LONG"
                  },
                  {
                      "name": "__time",
                      "type": "LONG"
                  },
                  {
                      "name": "added",
                      "type": "LONG"
                  },
                  {
                      "name": "channel",
                      "type": "STRING"
                  },
                  {
                      "name": "cityName",
                      "type": "STRING"
                  },
                  {
                      "name": "comment",
                      "type": "STRING"
                  },
                  {
                      "name": "commentLength",
                      "type": "LONG"
                  },
                  {
                      "name": "countryIsoCode",
                      "type": "STRING"
                  },
                  {
                      "name": "countryName",
                      "type": "STRING"
                  },
                  {
                      "name": "deleted",
                      "type": "LONG"
                  },
                  {
                      "name": "delta",
                      "type": "LONG"
                  },
                  {
                      "name": "deltaBucket",
                      "type": "LONG"
                  },
                  {
                      "name": "diffUrl",
                      "type": "STRING"
                  },
                  {
                      "name": "flags",
                      "type": "STRING"
                  },
                  {
                      "name": "isAnonymous",
                      "type": "STRING"
                  },
                  {
                      "name": "isMinor",
                      "type": "STRING"
                  },
                  {
                      "name": "isNew",
                      "type": "STRING"
                  },
                  {
                      "name": "isRobot",
                      "type": "STRING"
                  },
                  {
                      "name": "isUnpatrolled",
                      "type": "STRING"
                  },
                  {
                      "name": "metroCode",
                      "type": "STRING"
                  },
                  {
                      "name": "namespace",
                      "type": "STRING"
                  },
                  {
                      "name": "page",
                      "type": "STRING"
                  },
                  {
                      "name": "regionIsoCode",
                      "type": "STRING"
                  },
                  {
                      "name": "regionName",
                      "type": "STRING"
                  },
                  {
                      "name": "v0",
                      "type": "STRING"
                  }
              ],
              "shuffleSpec": {
                  "type": "maxCount",
                  "clusterBy": {
                      "columns": [
                          {
                              "columnName": "__boost",
                              "order": "ASCENDING"
                          }
                      ]
                  },
                  "partitions": 1
              },
              "maxWorkerCount": 1
          },
          "phase": "FINISHED",
          "workerCount": 1,
          "partitionCount": 1,
          "shuffle": "globalSort",
          "output": "localStorage",
          "startTime": "2024-07-31T15:20:21.355Z",
          "duration": 10,
          "sort": true
      }
  ],
  "counters": {
      "0": {
          "0": {
              "input0": {
                  "type": "channel",
                  "rows": [
                      24433
                  ],
                  "bytes": [
                      7393933
                  ],
                  "files": [
                      22
                  ],
                  "totalFiles": [
                      22
                  ]
              }
          }
      },
      "1": {
          "0": {
              "sortProgress": {
                  "type": "sortProgress",
                  "totalMergingLevels": -1,
                  "levelToTotalBatches": {},
                  "levelToMergedBatches": {},
                  "totalMergersForUltimateLevel": -1,
                  "triviallyComplete": true,
                  "progressDigest": 1
              }
          }
      }
  },
  "warnings": []
}

쿼리 결과 가져오기

완료된 쿼리의 결과를 가져옵니다. 결과는 페이지로 나뉘므로 선택적 page 파라미터로 가져올 결과를 정제할 수 있습니다. Druid는 각 페이지의 구성과 페이지 번호(id)에 대한 정보를 반환합니다. 페이지에 대한 자세한 내용은 쿼리 상태 가져오기를 참고하세요.

페이지 번호를 전달하지 않으면 모든 결과가 같은 응답에서 순차적으로 반환됩니다. 결과 집합이 크면 druid.router.http.readTimeout에 구성된 값에 따라 시간 초과가 발생할 수 있어요.

수집(ingestion) 쿼리의 쿼리 결과를 가져오면 빈 응답이 반환됩니다.

URL

GET /druid/v2/sql/statements/{queryId}/results

쿼리 파라미터
  • page (선택) — 타입: Int. 페이지 번호를 기준으로 결과를 가져옵니다. 지정하지 않으면 모든 결과가 같은 응답에서 page 0부터 N까지 순차적으로 반환됩니다.
  • resultFormat (선택) — 타입: String. 결과가 제공되는 형식을 정의합니다. 다음 옵션이 지원됩니다: arrayLines, objectLines, array, object, csv. 기본값은 object입니다.
  • filename (선택) — 타입: String. 설정하면 응답에 attachment; filename={filename} 값의 Content-Disposition 헤더를 첨부합니다. 파일 이름은 255자를 초과하지 않아야 하고 /, \, :, *, ?, ", <, >, |, \0, \n, \r 문자를 포함하지 않아야 합니다.
응답
  • 200 SUCCESS — 쿼리 결과를 성공적으로 조회함
  • 400 BAD REQUEST — 쿼리 진행 중. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "Summary of the encountered error.",
    "errorCode": "Well-defined error code.",
    "persona": "Role or persona associated with the error.",
    "category": "Classification of the error.",
    "errorMessage": "Summary of the encountered issue with expanded information.",
    "context": "Additional context about the error."
}
  • 404 NOT FOUND — 쿼리를 찾을 수 없거나 실패했거나 취소됨
  • 500 SERVER ERROR — 잘못된 쿼리로 인한 오류. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "Summary of the encountered error.",
    "errorCode": "Well-defined error code.",
    "persona": "Role or persona associated with the error.",
    "category": "Classification of the error.",
    "errorMessage": "Summary of the encountered issue with expanded information.",
    "context": "Additional context about the error."
}
샘플 요청

다음 예시는 지정된 ID query-f3bca219-173d-44d4-bdc7-5002e910352f의 쿼리 상태를 조회합니다.

cURL

curl "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql/statements/query-f3bca219-173d-44d4-bdc7-5002e910352f/results"

HTTP

GET /druid/v2/sql/statements/query-f3bca219-173d-44d4-bdc7-5002e910352f/results HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
샘플 응답
[
  {
      "__time": 1442018818771,
      "channel": "#en.wikipedia",
      "cityName": "",
      "comment": "added project",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 0,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Talk",
      "page": "Talk:Oswald Tilghman",
      "regionIsoCode": "",
      "regionName": "",
      "user": "GELongstreet",
      "delta": 36,
      "added": 36,
      "deleted": 0
  },
  {
      "__time": 1442018820496,
      "channel": "#ca.wikipedia",
      "cityName": "",
      "comment": "Robot inserta {{Commonscat}} que enllaça amb [[commons:category:Rallicula]]",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 1,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Rallicula",
      "regionIsoCode": "",
      "regionName": "",
      "user": "PereBot",
      "delta": 17,
      "added": 17,
      "deleted": 0
  },
  {
      "__time": 1442018825474,
      "channel": "#en.wikipedia",
      "cityName": "Auburn",
      "comment": "/* Status of peremptory norms under international law */ fixed spelling of 'Wimbledon'",
      "countryIsoCode": "AU",
      "countryName": "Australia",
      "isAnonymous": 1,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 0,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Peremptory norm",
      "regionIsoCode": "NSW",
      "regionName": "New South Wales",
      "user": "60.225.66.142",
      "delta": 0,
      "added": 0,
      "deleted": 0
  },
  {
      "__time": 1442018828770,
      "channel": "#vi.wikipedia",
      "cityName": "",
      "comment": "fix Lỗi CS1: ngày tháng",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 1,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Apamea abruzzorum",
      "regionIsoCode": "",
      "regionName": "",
      "user": "Cheers!-bot",
      "delta": 18,
      "added": 18,
      "deleted": 0
  },
  {
      "__time": 1442018831862,
      "channel": "#vi.wikipedia",
      "cityName": "",
      "comment": "clean up using [[Project:AWB|AWB]]",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Atractus flammigerus",
      "regionIsoCode": "",
      "regionName": "",
      "user": "ThitxongkhoiAWB",
      "delta": 18,
      "added": 18,
      "deleted": 0
  },
  {
      "__time": 1442018833987,
      "channel": "#vi.wikipedia",
      "cityName": "",
      "comment": "clean up using [[Project:AWB|AWB]]",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Agama mossambica",
      "regionIsoCode": "",
      "regionName": "",
      "user": "ThitxongkhoiAWB",
      "delta": 18,
      "added": 18,
      "deleted": 0
  },
  {
      "__time": 1442018837009,
      "channel": "#ca.wikipedia",
      "cityName": "",
      "comment": "/* Imperi Austrohongarès */",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 0,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Campanya dels Balcans (1914-1918)",
      "regionIsoCode": "",
      "regionName": "",
      "user": "Jaumellecha",
      "delta": -20,
      "added": 0,
      "deleted": 20
  },
  {
      "__time": 1442018839591,
      "channel": "#en.wikipedia",
      "cityName": "",
      "comment": "adding comment on notability and possible COI",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 1,
      "isRobot": 0,
      "isUnpatrolled": 1,
      "metroCode": 0,
      "namespace": "Talk",
      "page": "Talk:Dani Ploeger",
      "regionIsoCode": "",
      "regionName": "",
      "user": "New Media Theorist",
      "delta": 345,
      "added": 345,
      "deleted": 0
  },
  {
      "__time": 1442018841578,
      "channel": "#en.wikipedia",
      "cityName": "",
      "comment": "Copying assessment table to wiki",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "User",
      "page": "User:WP 1.0 bot/Tables/Project/Pubs",
      "regionIsoCode": "",
      "regionName": "",
      "user": "WP 1.0 bot",
      "delta": 121,
      "added": 121,
      "deleted": 0
  },
  {
      "__time": 1442018845821,
      "channel": "#vi.wikipedia",
      "cityName": "",
      "comment": "clean up using [[Project:AWB|AWB]]",
      "countryIsoCode": "",
      "countryName": "",
      "isAnonymous": 0,
      "isMinor": 0,
      "isNew": 0,
      "isRobot": 1,
      "isUnpatrolled": 0,
      "metroCode": 0,
      "namespace": "Main",
      "page": "Agama persimilis",
      "regionIsoCode": "",
      "regionName": "",
      "user": "ThitxongkhoiAWB",
      "delta": 18,
      "added": 18,
      "deleted": 0
  }
]

쿼리 취소

실행 중이거나 수락된 쿼리를 취소합니다.

URL

DELETE /druid/v2/sql/statements/{queryId}

응답
  • 200 OK — 쿼리가 취소될 수 있는 상태가 아니므로 no-op 연산
  • 202 ACCEPTED — 쿼리를 취소하도록 성공적으로 수락함
  • 404 SERVER ERROR — 잘못된 쿼리 ID. 다음 형식의 오류를 자세히 설명하는 JSON 객체를 반환합니다.
{
    "error": "Summary of the encountered error.",
    "errorCode": "Well-defined error code.",
    "persona": "Role or persona associated with the error.",
    "category": "Classification of the error.",
    "errorMessage": "Summary of the encountered issue with expanded information.",
    "context": "Additional context about the error."
}
샘플 요청

다음 예시는 지정된 ID query-945c9633-2fa2-49ab-80ae-8221c38c024da의 쿼리를 취소합니다.

cURL

curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/v2/sql/statements/query-945c9633-2fa2-49ab-80ae-8221c38c024da"

HTTP

DELETE /druid/v2/sql/statements/query-945c9633-2fa2-49ab-80ae-8221c38c024da HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
샘플 응답

성공한 요청은 HTTP 202 ACCEPTED 메시지 코드와 빈 응답 본문을 반환합니다.

더 알아보기 (Learn more)

  • 쿼리 컨텍스트 파라미터에 대한 자세한 내용은 SQL query context 문서를 참고하세요.
  • 딥 스토리지에서 쿼리하는 방법은 query from deep storage 문서를 확인해 보세요.