Skip to content

SQL Procedures API

Paid edition only. The compound procedures described below are available with the paid edition of Geo Data Connector. They are not included in the free edition.

Geo Data Connector provides four compound procedures that expose all application functionality directly from SQL. Use these to automate workflows, integrate with AI coding assistants, or manage data ingestion without launching the interactive application.

All compound procedures share the same signature:

sql
CALL SETUP.<procedure>('<action>', <params>);

where <action> identifies the operation and <params> is a VARIANT (JSON object) containing action-specific parameters. Pass NULL when no parameters are needed.

Every call returns a JSON string with a consistent structure:

json
{"ok": true, "action": "list", "data": {...}, "error": null}

Use PARSE_JSON() to extract fields from the result.

Database Context

Before calling any procedure, set the active database to the Geo Data Connector application database. This is the database that was created when you installed the Connector — its name matches the name you chose during installation (visible in Snowsight under Catalog → Apps).

sql
USE DATABASE GEO_DATA_CONNECTOR;

Replace GEO_DATA_CONNECTOR with your application database name. If you are unsure of the name, list your installed applications:

sql
SHOW APPLICATIONS;

The name column shows the application database name to use.

Without setting the database context, calls to SETUP.<procedure> will fail because Snowflake cannot resolve the schema.

Output Formats

All procedures support two output formats:

FormatSignatureReturnsBest for
JSON (default)CALL SETUP.<proc>('<action>', <params>)JSON stringAI coding assistants, scripts, programmatic consumers
TabularCALL SETUP.<proc>('<action>', <params>, 'table')Result setSnowsight SQL worksheets, interactive use

The tabular format renders data as native columns in Snowsight:

sql
-- JSON output (default)
CALL SETUP.GDC_TASK('list', NULL);

-- Tabular output (renders as a table in Snowsight)
CALL SETUP.GDC_TASK('list', NULL, 'table');

-- Tabular search results
CALL SETUP.GDC_DISCOVER('search', PARSE_JSON('{"q": "buildings Finland", "limit": 5}'), 'table');

The tabular format uses CALL syntax. The SELECT * FROM TABLE(...) syntax is not supported because tabular procedures use dynamic columns that vary by action.

Error Handling

When a call fails, ok is false and the error object contains a code and message:

json
{"ok": false, "action": "get_setting", "data": null, "error": {"code": "INVALID_PARAMETER", "message": "..."}}
Error CodeMeaning
UNKNOWN_ACTIONThe action name is not recognized
MISSING_PARAMETERA required parameter was not provided
INVALID_PARAMETERA parameter value is not valid
NOT_FOUNDThe requested resource does not exist
CONFIG_MISSINGA required configuration setting has not been set
NO_SCHEDULEA schedule is required but was not provided
DISCOVERY_ERRORThe Connector could not reach the external data source
SEARCH_ERRORThe search request failed
INTERNAL_ERRORAn unexpected error occurred

Configuration (GDC_CONFIG)

Available to the APP_ADMIN role. Manages application settings and checks infrastructure status.

Actions

list_settings

Returns all user-facing configuration settings.

Parameters: None. Pass NULL.

Response: Array of {KEY, VALUE} objects.

sql
CALL SETUP.GDC_CONFIG('list_settings', NULL);

get_setting

Returns a single setting by key.

ParameterRequiredTypeDescription
keyYesstringThe setting key to retrieve

Allowed keys: ingestion-database, notification-email, notify-task-success, notify-task-failure, notify-idle-warning, notify-auto-suspend, notify-idle-hours, auto-suspend-enabled, auto-suspend-timeout, app-edition, app-version, instance-id.

Returns INVALID_PARAMETER if the key is not in the allowed list. Returns null data if the key exists in the allowed list but has not been set.

sql
CALL SETUP.GDC_CONFIG('get_setting', PARSE_JSON('{"key": "ingestion-database"}'));

set_setting

Creates or updates a setting.

ParameterRequiredTypeDescription
keyYesstringThe setting key to set
valueYesstringThe value to assign

Writable keys: ingestion-database, notification-email, notify-task-success, notify-task-failure, notify-idle-warning, notify-auto-suspend, notify-idle-hours, auto-suspend-enabled, auto-suspend-timeout.

The keys app-edition, app-version, and instance-id are read-only and cannot be changed. Setting ingestion-database to a non-empty value also creates the database if it does not already exist.

Response: {OK: true, ERROR: null} on success.

sql
-- Set the ingestion database
CALL SETUP.GDC_CONFIG('set_setting', PARSE_JSON('{"key": "ingestion-database", "value": "MY_GDC_DATA"}'));

-- Enable email notifications on task failure
CALL SETUP.GDC_CONFIG('set_setting', PARSE_JSON('{"key": "notify-task-failure", "value": "true"}'));

get_warehouse_status

Checks whether the compute warehouse is available.

Parameters: None. Pass NULL.

Response: {available: true|false}.

sql
SELECT PARSE_JSON(SETUP.GDC_CONFIG('get_warehouse_status', NULL)):data:available::BOOLEAN;

get_eai_status

Checks whether External Access Integration is configured (required for discovery and ingestion).

Parameters: None. Pass NULL.

Response: {configured: true|false}.

sql
SELECT PARSE_JSON(SETUP.GDC_CONFIG('get_eai_status', NULL)):data:configured::BOOLEAN;

get_auto_suspend_status

Returns the current auto-suspend configuration.

Parameters: None. Pass NULL.

Response: {enabled: true|false, timeout_minutes: integer, timeout_seconds: integer}.

sql
CALL SETUP.GDC_CONFIG('get_auto_suspend_status', NULL);

Connections (GDC_CONNECTION)

Available to the APP_USER role. Manages saved data source connections.

Actions

count

Returns the number of saved connections.

Parameters: None. Pass NULL.

Response: {count: integer}.

sql
SELECT PARSE_JSON(SETUP.GDC_CONNECTION('count', NULL)):data:count::INT;

list

Returns saved connections with pagination.

ParameterRequiredTypeDefaultDescription
pageNointeger1Page number (1-indexed)
lengthNointeger10Rows per page
sortkeyNostringNAMEColumn to sort by
sortorderNostringascSort direction: asc or desc

Response: Array of connection objects with fields: URI, TYPE, NAME_SERVICE, DESCRIPTION, DATASET_COUNT, AUTH_METHOD, ACCESSED, CREATED, MODIFIED.

sql
CALL SETUP.GDC_CONNECTION('list', PARSE_JSON('{"page": 1, "length": 10}'));

upsert

Creates a new connection or updates an existing one. Connections are identified by their URI.

ParameterRequiredTypeDescription
uriYesstringThe data source URL
typeYesstringService type (e.g., WFS, WMS, WCS, WMTS, CSW)
name_serviceNostringService name (as reported by the data source)
descriptionNostringUser-provided description
dataset_countNointegerNumber of datasets in the service
auth_methodNostringAuthentication method: none (default) or basic
auth_usernameNostringUsername or API key (write-only, stored encrypted)
auth_passwordNostringPassword (write-only, stored encrypted, optional)

When auth_method is basic, auth_username is required for new connections. On updates, omitting auth_username or auth_password preserves the existing encrypted value. Credentials are never returned by list or any other read action.

Response: {rows_inserted: integer, rows_updated: integer}.

sql
-- Connection without authentication
CALL SETUP.GDC_CONNECTION('upsert', PARSE_JSON('{
  "uri": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "type": "WFS",
  "name_service": "NLS Finland INSPIRE WFS"
}'));

-- Connection with API key authentication
CALL SETUP.GDC_CONNECTION('upsert', PARSE_JSON('{
  "uri": "https://avoin-paikkatieto.maanmittauslaitos.fi/tiedostopalvelu/ogcapi/v1",
  "type": "OGC API Features",
  "name_service": "NLS Finland File Service",
  "auth_method": "basic",
  "auth_username": "your-api-key"
}'));

delete

Deletes a saved connection by URI.

ParameterRequiredTypeDescription
uriYesstringThe connection URI to delete

Response: {rows_deleted: integer}.

sql
CALL SETUP.GDC_CONNECTION('delete', PARSE_JSON('{"uri": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple"}'));

Tasks (GDC_TASK)

Available to the APP_USER role. Requires External Access Integration (connectivity to external data sources). Manages the full lifecycle of ingestion tasks — create, delete, suspend, resume, schedule — and provides read-only access to task details, run history, and table information.

Schedule Values

Schedule parameters accept one of three values (case-insensitive):

ValueFrequency
DailyOnce per day
WeeklyOnce per week
MonthlyOnce per month

The Connector converts these to Snowflake CRON expressions automatically.

Actions — Task Lifecycle

create

Creates an ingestion task for a data source. If a task already exists for the same source, it is recreated with a fresh state.

ParameterRequiredTypeDescription
urlYesstringThe data source URL
typeYesstringService type (e.g., WFS, WMS, WCS, WMTS)
datasetYesstringThe dataset name within the service
scheduleNostringDaily, Weekly, or Monthly. If omitted, the task is created but not scheduled.

Response: {name: string, enabled: boolean}. The name is a deterministic identifier derived from the source parameters. The enabled field is true only when a schedule is provided and registration succeeds.

Prerequisite: The ingestion-database setting must be configured via GDC_CONFIG('set_setting', ...) before creating tasks. Returns CONFIG_MISSING if not set.

sql
-- Create a daily WFS ingestion task
CALL SETUP.GDC_TASK('create', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/bu_mtk_polygon",
  "type": "WFS",
  "dataset": "bu-core2d:Building",
  "schedule": "Daily"
}'));

-- Create a task without a schedule (manual execution only)
CALL SETUP.GDC_TASK('create', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/bu_mtk_polygon",
  "type": "WFS",
  "dataset": "bu-core2d:Building"
}'));

delete

Deletes a task, removes all associated Snowflake task objects, and deregisters the data source. Provide either the task name or the source identifiers.

ParameterRequiredTypeDescription
nameEither name or all three source paramsstringThe task name
urlstringThe data source URL
typestringService type
datasetstringThe dataset name

Response: {rows_deleted: integer}.

sql
-- Delete by name
CALL SETUP.GDC_TASK('delete', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675"}'));

-- Delete by source identifiers
CALL SETUP.GDC_TASK('delete', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/bu_mtk_polygon",
  "type": "WFS",
  "dataset": "bu-core2d:Building"
}'));

suspend

Suspends a scheduled task and disables automatic ingestion.

ParameterRequiredTypeDescription
nameYesstringThe task name

Response: null. The task is disabled. If the task was not already in a terminal state, its status changes to INACTIVE.

sql
CALL SETUP.GDC_TASK('suspend', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675"}'));

resume

Resumes a suspended task. Uses the task's existing schedule unless overridden.

ParameterRequiredTypeDescription
nameYesstringThe task name
scheduleNostringDaily, Weekly, or Monthly. If omitted, uses the task's existing schedule. Returns NO_SCHEDULE if the task has no schedule and none is provided.

Response: {enabled: boolean}.

sql
-- Resume with existing schedule
CALL SETUP.GDC_TASK('resume', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675"}'));

-- Resume with a new schedule
CALL SETUP.GDC_TASK('resume', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675", "schedule": "Weekly"}'));

set_schedule

Changes the schedule of an existing task. The task is briefly suspended and resumed with the new schedule.

ParameterRequiredTypeDescription
nameYesstringThe task name
scheduleYesstringDaily, Weekly, or Monthly

Response: {schedule: string, enabled: boolean}.

sql
CALL SETUP.GDC_TASK('set_schedule', PARSE_JSON('{
  "name": "INGESTION_927d79958453454b267925f28d4f4675",
  "schedule": "Monthly"
}'));

unset_schedule

Removes the schedule from a task. The task is suspended and will only run when executed manually.

ParameterRequiredTypeDescription
nameYesstringThe task name

Response: null.

sql
CALL SETUP.GDC_TASK('unset_schedule', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675"}'));

execute

Runs a task immediately, regardless of its schedule. The task's status changes to IN PROGRESS.

ParameterRequiredTypeDescription
nameYesstringThe task name

Response: {name: string}.

sql
CALL SETUP.GDC_TASK('execute', PARSE_JSON('{"name": "INGESTION_927d79958453454b267925f28d4f4675"}'));

Actions — Task Information

count

Returns the number of ingestion tasks.

Parameters: None. Pass NULL.

Response: {count: integer}.

sql
SELECT PARSE_JSON(SETUP.GDC_TASK('count', NULL)):data:count::INT AS task_count;

list

Returns ingestion tasks with pagination.

ParameterRequiredTypeDefaultDescription
pageNointeger1Page number (1-indexed)
lengthNointeger10Rows per page
sortkeyNostringTASK_NAMEColumn to sort by (see below)
sortorderNostringascSort direction: asc or desc
filterNostringFilter tasks by exact name (case-insensitive)
statusNostringFilter tasks by status: SUCCESS, FAILED, RETRYING, IN PROGRESS, or INACTIVE (case-insensitive)
enabledNostringFilter tasks by enabled state: true or false

Sort keys: TASK_NAME, SOURCE_TYPE, DATA_SOURCE, DATASET, TARGET_TABLE, STATUS, NEXT_ETA, ENABLED, SCHEDULE, CREATED, LAST_RUN.

Response: Array of task objects with fields: TASK_NAME, SOURCE_TYPE, DATA_SOURCE, DATASET, TARGET_TABLE, STATUS, STATUS_NOTE, NEXT_ETA, LAST_RUN, CREATED, ENABLED, SCHEDULE.

The DATA_SOURCE field contains the title of the data source. Falls back to the URL if no title is available. The STATUS field contains one of: SUCCESS, FAILED, RETRYING, IN PROGRESS, or INACTIVE. STATUS_NOTE provides context for the current status: while ingestion is running, it shows the current execution phase (e.g., "3/6 Retrieving"); when the task has failed, it contains the failure description including the phase where it occurred; when retrying, it shows the retry count and error (e.g., "Retry 1/2 — timeout"). NEXT_ETA shows the next scheduled run with a relative time suffix (e.g., "2026-04-08 06:00:00 (in 12 hours)"). TARGET_TABLE is the fully qualified Snowflake table name (e.g., MY_DB.SCHEMA.TABLE). ENABLED shows "Enabled" or "Disabled".

sql
-- List first 5 tasks sorted by name
CALL SETUP.GDC_TASK('list', PARSE_JSON('{"page": 1, "length": 5, "sortkey": "TASK_NAME"}'));

-- List tasks sorted by most recent run (newest first)
CALL SETUP.GDC_TASK('list', PARSE_JSON('{"sortkey": "LAST_RUN", "sortorder": "desc"}'));

-- List only enabled tasks
CALL SETUP.GDC_TASK('list', PARSE_JSON('{"enabled": "true"}'));

-- List failed tasks
CALL SETUP.GDC_TASK('list', PARSE_JSON('{"status": "FAILED"}'));

-- Tabular output
CALL SETUP.GDC_TASK('list', NULL, 'table');

get

Returns a single task. Provide either the task name or the source identifiers.

ParameterRequiredTypeDescription
nameEither name or all three source paramsstringThe task name (e.g., INGESTION_abc123def456)
urlstringThe data source URL
typestringService type (e.g., WFS, WMS)
datasetstringThe dataset name within the service

Response: Same columns as list — a single task object. Returns null if the task does not exist.

sql
-- Get by name
CALL SETUP.GDC_TASK('get', PARSE_JSON('{"name": "INGESTION_abc123def456"}'));

-- Get by source identifiers
CALL SETUP.GDC_TASK('get', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/bu_mtk_polygon",
  "type": "WFS",
  "dataset": "bu-core2d:Building"
}'));

runs

Returns the ingestion run history for a task, sorted newest first.

ParameterRequiredTypeDescription
nameYesstringThe task name

Response: Array of run objects with fields: NAME, START_TIME, END_TIME, STATUS, STATUS_NOTE, ERROR_MESSAGE, DURATION, TRIGGER, ROWS_LOADED. While a run is active, STATUS_NOTE shows the current execution phase (null for completed runs). ERROR_MESSAGE provides a failure description for failed runs (null for succeeded runs). DURATION is a formatted duration string (e.g., "2m 30s"). TRIGGER indicates how the run was started (e.g., "SCHEDULED", "MANUAL").

sql
CALL SETUP.GDC_TASK('runs', PARSE_JSON('{"name": "INGESTION_abc123def456"}'));

table_info

Describes the ingested data table — its columns, row count, and a sample of rows.

ParameterRequiredTypeDescription
nameYesstringThe task name

Response: {table: string, column_count: integer, row_count: integer, columns: [{name, type}, ...], sample: [{...}, ...]}. The sample contains up to 10 rows with column values truncated to 200 characters.

Returns NOT_FOUND if the task or its target table does not exist.

sql
CALL SETUP.GDC_TASK('table_info', PARSE_JSON('{"name": "INGESTION_abc123def456"}'));

metadata

Returns raster metadata for image-based source types.

ParameterRequiredTypeDescription
nameYesstringThe task name

Applicable source types: WMS, WMTS, WCS, OGC API Maps, OGC API Coverages. Returns empty metadata for other source types.

Response: {exists: boolean, table: string|null, metadata: {...}}. The metadata object contains source-specific fields such as coordinate reference system, pixel dimensions, and geographic extent.

sql
CALL SETUP.GDC_TASK('metadata', PARSE_JSON('{"name": "INGESTION_abc123def456"}'));

stage_file_info

Returns information about the staged image file for a raster ingestion task.

ParameterRequiredTypeDescription
nameYesstringThe task name

Applicable source types: WMS, WMTS. Returns empty data for other source types.

Response: {exists: boolean, file_location: string|null, file_size: integer, file_name: string|null}.

sql
CALL SETUP.GDC_TASK('stage_file_info', PARSE_JSON('{"name": "INGESTION_abc123def456"}'));

Discovery (GDC_DISCOVER)

Available to the APP_USER role. Requires External Access Integration. Browse and search geospatial data sources.

Note: Discovery and search calls retrieve data directly from external services and indexes. Response times depend on the external service. Only fields visible in the Connector's user interface are included in responses.

Actions

Browses an OGC service by URL. Use this to discover available datasets, list them, and inspect dataset details.

ParameterRequiredTypeDefaultDescription
urlYesstringThe OGC service URL to browse
pageNointeger1Page number for paginated results (10 items per page)
node_idNostringNavigate to a specific dataset within the service
numberNointegerSelect a source by its row number (as shown in the overview)
item_numberNointegerDrill into a specific item within the selected source
qNostringFilter results within the service (minimum 2 characters)

Note: Do not include authentication credentials (such as API keys or passwords) in the url parameter. URLs containing query parameters such as apikey, token, or password will be rejected. To access authenticated services, first save the connection using GDC_CONNECTION('upsert', ...) with the auth_method, auth_username, and auth_password parameters. See Connections (GDC_CONNECTION) for details.

Response: The navigate action may return data directly or a processing ticket, depending on whether the result is immediately available:

  • Immediate response — Returns an object describing the current navigation level (see below).
  • Deferred response — Returns {type: "ticket", ticket_id: "...", status: "processing"}. Use the status action to poll until the result is ready (typically 5–30 seconds). See the status action below.

When discovery data is returned (either immediately or after polling), the response structure depends on the navigation depth:

  • Service overview ({url}) — {source: {...}, items: [...], source_count, service_health, ...} — the data source summary plus its first-level items.
  • Service list ({url} returning multiple sources) — {sources: [...], source_count} — each entry is a separate data source to choose from with number.
  • Items within the selected source ({url, number}) — {source, items, ...} — the chosen source with its items listed.
  • Item detail ({url, number, item_number}) — either {source, ...} (for a catalog record, where the Connector drills through the record to the underlying data source) or {item, columns, ...} (for a dataset within a service, where the dataset is returned with its column schema). See Two item kinds below.

Each item in the items array carries a 1-based number field indicating its position in the list — use this value as item_number to drill into that item.

Table format — listing datasets or catalog records. In the 'table' format, calling navigate with only a url returns a single row describing the data source (title, type, url, dataset counts). It does not list the datasets or catalog records as rows. To get those as rows, add "number": 1 (or the row number of the source you want to expand when the URL returned multiple sources):

sql
-- Table format: just the service summary (one row)
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://kart.hi.no/mareano/mareano_kjemi/perylen/ows?service=WFS"
}'), 'table');

-- Table format: list the service's datasets (or records) as rows
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://kart.hi.no/mareano/mareano_kjemi/perylen/ows?service=WFS",
  "number": 1
}'), 'table');

This is the standard pattern for listing datasets in table format, and the only way to see individual datasets/records as rows. In the 'json' format, the same {url} call already returns both the source summary and the items list together, so number is only needed when the URL exposes multiple sources and you want to select one.

Two item kinds. Items can be either nested data sources (when browsing a catalog such as CSW or OGC API Records, whose entries are themselves data sources) or datasets (when browsing a dataset-providing service such as WFS, WMS, WCS, WMTS, or OGC API Features). The fields present on each item reflect what the Connector's Discovery page shows for that kind:

Item kindTypical servicesItem fieldsitem_number result
Nested data sourceCSW, OGC API Recordsnumber, title, description, type, url, service_provider, data_source_count, dataset_countThe Connector drills through the record to the underlying data source and returns it as {source, ...} (or {sources: [...]} if the record points at multiple services) — typically a fully populated WFS/WMS service with its own url, ready to navigate further.
DatasetWFS, WMS, WCS, WMTS, OGC API Features/Maps/Tiles/Coveragesnumber, name, title, description, type, source_type, url, bbox_wgs84, crs_epsg_code, crs_name, column_count, row_count, is_ingestible, ingestibility_note, column_schema_noteThe selected dataset plus a columns list describing its column schema (name, type, description).

The response includes only the fields with meaningful values. Metadata fields such as service_health, search_active, total_matched, and search_capabilities are omitted when they have no content.

Dataset items include is_ingestible (true/false). When false, ingestibility_note provides a human-readable explanation (e.g., unsupported dataset type, invalid coordinate reference system, pixel count exceeding the limit, or a temporarily unreachable ingestion URL). Dataset items may also include column_schema_note when the column schema could not be resolved during discovery — an informational message; ingestion may still be possible.

Every discovery response includes a service_health object with the following fields:

FieldDescription
statusHEALTHY, DEGRADED, DOWN, HALF_OPEN, or UNKNOWN
last_probeISO 8601 timestamp of the last health check (null if never checked)
response_time_msResponse time of the most recent health check in milliseconds (null if never checked)
uptime_pct_7d7-day uptime percentage (null if insufficient data)
uptime_pct_30d30-day uptime percentage (null if insufficient data)
avg_response_ms_7d7-day average response time in milliseconds (null if insufficient data)
availabilityavailable, temporarily_unavailable, or permanently_unavailable (null if never checked)
sql
-- Browse a WFS service
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "page": 1
}'));

-- Drill into a specific dataset
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "node_id": "au:AdministrativeBoundary"
}'));

-- Filter datasets within a service
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "q": "building"
}'));

-- Tabular output (one row per source — overview)
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple"
}'), 'table');

-- Tabular output with drill-down (show items within source 1)
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "number": 1
}'), 'table');

-- Drill into a specific dataset (item 3 within source 1) — shows column schema as rows
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/simple",
  "number": 1,
  "item_number": 3
}'), 'table');

-- Drill into a catalog record (item 3 within a CSW catalog) — the Connector drills
-- through the record and returns the underlying data source (e.g. the WFS service)
-- as a single row, ready to navigate further.
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&request=GetCapabilities",
  "number": 1,
  "item_number": 3
}'), 'table');

status

Polls for the result of an asynchronous discovery request. Use this when navigate returns a ticket instead of immediate results.

ParameterRequiredTypeDescription
ticket_idYesstringThe ticket ID returned by navigate or a previous status call

Response: The response includes a status field:

  • processing — Discovery is still in progress. Wait 2–4 seconds and poll again with the same ticket_id.
  • completed — Discovery data is ready and included in the response (same structure as an immediate navigate response).
  • failed — Discovery failed. Check the error field for details.
sql
-- Poll for discovery results
CALL SETUP.GDC_DISCOVER('status', PARSE_JSON('{"ticket_id": "abc-123-def-456"}'));

Empty responses

When navigate or status returns completed but the response contains no source, sources, or items, it means the Connector reached the URL but found no geospatial data sources. The response includes a service_health object indicating the health status of the service.

Common reasons for an empty response:

  • Incorrect URL — The URL does not point to a valid OGC service. Verify the URL includes the correct service endpoint.
  • Decommissioned service — The service was previously available but has been taken offline or moved to a different URL.
  • Unsupported service version — The service uses an OGC protocol version that the Connector does not support.
  • Network or access restrictions — The service is behind a firewall, requires authentication, or blocks external access.

In tabular output, an empty response shows a single row with STATUS and any available SERVICE_HEALTH_* columns.

Check the service_health.status field: HEALTHY or DEGRADED indicates the service was reachable but returned no datasets; UNKNOWN or DOWN suggests the service could not be probed or is unreachable.

Searches the Connector's dataset index by keyword. Returns matching datasets ranked by relevance.

ParameterRequiredTypeDefaultDescription
qYesstringSearch query (minimum 2 characters)
limitNointeger20Maximum results to return
offsetNointeger0Number of results to skip (for pagination)
bboxNoobjectGeographic area filter: {"west": number, "south": number, "east": number, "north": number} in WGS 84 coordinates
filtersNoobjectFilter results by country or service type: {"country": "FI", "type": "WFS"}. Both fields are optional.

Response: {results: [...], total: integer, query_info: {...}}. Each result includes a relevance score, service type, source name, and a discovered field showing when the dataset was indexed (e.g., "2 days ago"). The total field indicates the total number of matches (may exceed limit). The query_info object includes query (the original search query) and execution_time_ms (query duration in milliseconds). When the query mentions a geographic region, the Connector automatically uses spatial context to improve relevance.

sql
-- Search for elevation data in Finland
CALL SETUP.GDC_DISCOVER('search', PARSE_JSON('{"q": "elevation data finland", "limit": 10}'));

-- Search with geographic area filter (Helsinki region)
CALL SETUP.GDC_DISCOVER('search', PARSE_JSON('{
  "q": "buildings",
  "bbox": {"west": 24.5, "south": 60.1, "east": 25.2, "north": 60.4},
  "limit": 10
}'));

-- Filter by country and service type
CALL SETUP.GDC_DISCOVER('search', PARSE_JSON('{
  "q": "geology",
  "filters": {"country": "FI", "type": "WFS"},
  "limit": 10
}'));

-- Tabular output (one row per result with TOTAL column)
CALL SETUP.GDC_DISCOVER('search', PARSE_JSON('{"q": "protected areas", "limit": 5}'), 'table');

URLs with query parameters

Some OGC service URLs contain & characters (e.g., ?service=CSW&request=GetCapabilities). These work without any special handling in Snowsight worksheets:

sql
-- Works in Snowsight — no escaping needed
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&request=GetCapabilities",
  "page": 1
}'));

-- Tabular output — overview (1 service row)
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&request=GetCapabilities"
}'), 'table');

-- Tabular output — drill into source 1 (show items as rows)
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&request=GetCapabilities",
  "number": 1
}'), 'table');

-- Tabular output — drill into catalog record 3 within source 1. Because the
-- underlying service is a CSW catalog, the Connector drills through the record
-- and returns the underlying data source (e.g. a WFS service) as a single row.
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&request=GetCapabilities",
  "number": 1,
  "item_number": 3
}'), 'table');

If your SQL client interprets & as a variable substitution marker, use && to escape it:

sql
-- Double && escapes the ampersand in clients that use & for variable substitution
CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{
  "url": "https://www.geonorge.no/geonetwork/srv/nor/csw?service=CSW&&request=GetCapabilities",
  "page": 1
}'));

Troubleshooting

SQL template rendering error with URLs

When using the Snowflake CLI (snow sql), URLs containing & characters may cause:

SQL template rendering error: 'request' is undefined

This is a client-side variable substitution feature in the Snowflake CLI. Disable it with --enable-templating NONE:

bash
snow sql --enable-templating NONE --query "CALL SETUP.GDC_DISCOVER('navigate', PARSE_JSON('{\"url\": \"https://example.com/csw?service=CSW&request=GetCapabilities\"}'));"

This does not affect Snowsight worksheets or Cortex Analyst.

See also: AI Assistant Integration — use these procedures with Snowflake Cortex Code or Claude Code.

© 2016-2026 Smart Data Hub Ltd.