curl --request POST \
--url https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"database_name": "<string>",
"schema_name": "<string>",
"table_name": "<string>"
}
'import requests
url = "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table"
payload = {
"database_name": "<string>",
"schema_name": "<string>",
"table_name": "<string>"
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({database_name: '<string>', schema_name: '<string>', table_name: '<string>'})
};
fetch('https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'database_name' => '<string>',
'schema_name' => '<string>',
'table_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table"
payload := strings.NewReader("{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"columns": [
{
"name": "<string>",
"type": "<string>",
"kind": "<string>",
"is_null": true,
"default": "<string>",
"primary_key": "<string>",
"unique_key": "<string>",
"check": "<string>",
"expression": "<string>",
"comment": "<string>",
"policy_name": "<string>",
"privacy_domain": "<string>",
"clustering_information": {
"average_depth": 123,
"average_overlaps": 123,
"cluster_by_keys": "<string>",
"clustering_errors": [
{}
],
"total_constant_partition_count": 123,
"total_partition_count": 123,
"partition_depth_histogram": {},
"version": "<string>"
}
}
],
"clustering_key": {
"average_depth": 123,
"average_overlaps": 123,
"cluster_by_keys": "<string>",
"clustering_errors": [
{}
],
"total_constant_partition_count": 123,
"total_partition_count": 123,
"partition_depth_histogram": {},
"version": "<string>"
},
"version": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Describe a Snowflake table
Get the columns of a table, with how well the table is clustered on each.
For each request, SELECT runs the SELECT stored procedure that is installed in your Snowflake account. It runs one query for each column that is not semi-structured, and one for the clustering key, so the cost and the time increase with the number of columns. The queries need a running warehouse and use credits in your account. SELECT does not keep the result, so each request runs all the queries again.
When the stored procedure is not set up for the account, the response is a
409 with the code describe_procedure_unavailable. The detail member
tells what to set up.
curl --request POST \
--url https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"database_name": "<string>",
"schema_name": "<string>",
"table_name": "<string>"
}
'import requests
url = "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table"
payload = {
"database_name": "<string>",
"schema_name": "<string>",
"table_name": "<string>"
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({database_name: '<string>', schema_name: '<string>', table_name: '<string>'})
};
fetch('https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'database_name' => '<string>',
'schema_name' => '<string>',
'table_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table"
payload := strings.NewReader("{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/snowflake-accounts/{snowflake_account_id}/actions/describe-table")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"database_name\": \"<string>\",\n \"schema_name\": \"<string>\",\n \"table_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"columns": [
{
"name": "<string>",
"type": "<string>",
"kind": "<string>",
"is_null": true,
"default": "<string>",
"primary_key": "<string>",
"unique_key": "<string>",
"check": "<string>",
"expression": "<string>",
"comment": "<string>",
"policy_name": "<string>",
"privacy_domain": "<string>",
"clustering_information": {
"average_depth": 123,
"average_overlaps": 123,
"cluster_by_keys": "<string>",
"clustering_errors": [
{}
],
"total_constant_partition_count": 123,
"total_partition_count": 123,
"partition_depth_histogram": {},
"version": "<string>"
}
}
],
"clustering_key": {
"average_depth": 123,
"average_overlaps": 123,
"cluster_by_keys": "<string>",
"clustering_errors": [
{}
],
"total_constant_partition_count": 123,
"total_partition_count": 123,
"partition_depth_histogram": {},
"version": "<string>"
},
"version": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Body
The table to describe.
Response
Successful Response
The columns of a Snowflake table, with their clustering information.

