Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

SQL Comprehension

Introduction

Matching of Sundeck QLike expressions rely on comprehension of Snowflake SQL. Since Snowflake expands and extends their SQL dialect with each release, there will always be some Snowflake commands and grammar which Sundeck does not fully comprehend. We support the vast majority of commonly used Snowflake statements and grammar, and are working continually to add comprehension to newer and/or less-commonly encountered areas of Snowflake’s grammar.

In cases where Sundeck does not fully comprehend a Snowflake statement, we will parse the statement and provide the ability to match the query by statement type and a single wildcard.

Here we detail the statement types which are fully comprehended, and those where we currently provide prefix matching via QLike. Note we are constantly expanding our comprehension of Snowflake SQL, so this list changes often. Check back frequently for updates!

Fully-supported SQL Statements

In this category, the entire statement is supported. This means that wildcards (?) are allowed in QLike expressions for any non-keyword token.

The following are Sundeck Known Statement Types:

  • SELECT
  • CALL
  • EXECUTE IMMEDIATE
  • BEGIN … END
  • USE [SCHEMA | DATABASE]
  • ALTER SESSION SET
  • CREATE PROCEDURE
  • CREATE TASK

Prefix-supported SQL Statements

Queries of this type are parsed up to the first non-keyword token. For example, with query CREATE TABLE foo (bar VARCHAR) Sundeck parses to CREATE TABLE, but then skips the remainder of the statement. QLike expressions for prefix-supported statements permit a single wildcard following the prefix (for example CREATE TABLE ?).

Note that prefix-supported query types are automatically generalized to include the matching of additional keywords (modifiers) which appear within the query prefix. This means that the QLike expression CREATE TABLE ? will match other types of CREATE TABLE statements, such as CREATE TEMPORARY TABLE ..., CREATE TRANSIENT TABLE ..., etc. This is because the QLike expression is generalized to match any CREATE TABLE statement, regardless of the modifiers which appear within the query.

Statements which currently support prefix matching include:

  • CREATE …
  • DROP…
  • ALTER…
  • DESCRIBE…
  • SHOW…
  • USE…
  • TRUNCATE…
  • INSERT…
  • MERGE…
  • COMMENT…
  • EXECUTE TASK…
  • EXPLAIN…
  • GET…
  • GRANT…
  • LIST…
  • LS …
  • PUT…
  • REMOVE…
  • REVOKE…
  • RM…
  • ROLLBACK…
  • SET…
  • START TRANSACTION…
  • UNDROP…
  • UNSET…