Snowflake SQL Parser

The built-in Snowflake SQL engine in General SQL Parser provides in-depth analysis of an organization's Snowflake SQL script(including function/procedure of course) at a detailed level that would not be possible without a complete, 100% compatible query parser.

Parsing SQL is a notoriously difficult task because the syntax of Snowflake SQL is very ambiguous in a lot of places. Many people have attempted to write a full SQL grammar with parser generate tool and failed.

Now you can fully incorporated this Snowflake SQL parser into your products, instantly adding a powerful SQL processing capability to your program. With the right library, you can get your job done quickly by saving hundred of hours, if not more, on developing time.

Snowflake column-level data lineage discovery

One of the fantastic features provided by this Snowflake SQL parser is discovering the lineage from the complex Snowflake queries or databases.

Below are snowflake SQL queries using COPY command to Load data from Amazon S3.

create or replace temporary table mycsvtable (
  id integer,
  last_name string,
  first_name string,
  company string,
  email string,
  workphone string,
  cellphone string,
  streetaddress string,
  city string,
  postalcode string);
create or replace file format mycsvformat
  type = 'CSV'
  field_delimiter = '|'
  skip_header = 1;

create or replace stage my_csv_stage
  file_format = mycsvformat
  url = 's3://snowflake-docs';

copy into mycsvtable
  from @my_csv_stage/tutorials/dataloading/contacts1.csv
  on_error = 'skip_file';

create materialized view exttable_csv_mv
select ID , LAST_NAME , FIRST_NAME ,COMPANY,EMAIL  from mycsvtable;

Data lineage discovered from the previous SQL queries:

Snowflake data lineage diagram

Clean up messy SQL codes

Easily integrate SQL formatter into your application for a color coded layout that is easy to navigate, giving your product a professional feeling.

Detect SQL syntax errors

Your application will be able to validate SQL syntax before a database executes the query. This is very useful especially if your SQL was dynamically built based on user input.

Rid SQL injections

Avoid being vulnerable to SQL injection in your ASP.NET or Java application, by automatically detecting malicious SQL segment with our ready-to-use library.

Retrieve/Refactor table & column name

Precisely determining and renaming every table and column in stored SQL statements is very complex with a lot of nesting and sub-queries. With us, however, that tedious procedure can become hassle-free one for you.

Find affected SQL objects

Parse out the affect SQL objects in a SQL file that can have many different types of SQL (select, insert, create, drop, etc), and helping to determine what is being affected, including but not limited to schema, table, column.

Discover the relationship in DDL

Quickly locate the primary key and/or foreign key in DDL scripts to figure out the complex relationship among the various tables. Extracted table, attribute names, data types can be used to generate the CRUD-Statements.

Query parse tree in XML

Parsing SQL is a notoriously difficult task, but we are here to help. You will be provided with a SQL query parse tree in XML output that will allow you to further process SQL scripts.

Rewrite and convert SQL

Modify SQL expression/condition in where clause to reconstruct a new filter. Rewrite Oracle proprietary joins to ANSI SQL compliant joins. Translate SQL between different databases.

CRUD Reportor

Read complex and large SQL scripts to find out tables have Create, Read, Update, Delete and Insert operations against them immediately, it's almost impossible to do that without help with a tool.

SQL Parser can even do more

We are dedicated to constantly improving our product so it will be easier to use with more flexibility, making it a valuable asset to your software product. Here, we have provided you with additional demos that may be helpful to you.


Supported SQL

Level 1: SQL parser recognizes that this is a valid SQL statement, but can't validate the syntax of this specific SQL statement. This demo shows how General SQL Parser can handle this kind of SQL statements.

Level 2: SQL Parser fully parses this kind of SQL statements with detailed query parse tree node elements and provides everything you need to analyze and manipulate this kind of SQL statements.

Level 1 statements: 106, Level 2 statements: 85, generated by General SQL Parser Java Version,2020/06/05

SQL statements Level 1 Level 2
alter account Y Y
alter database Y Y
alter file format Y Y
alter function Y Y
alter network policy Y Y
alter pipe Y Y
alter resource monitor Y Y
alter role Y Y
alter schema Y Y
alter session Y Y
alter sequence Y Y
alter share Y Y
alter stage Y Y
alter table Y Y
alter user Y Y
alter view Y Y
alter warehouse Y Y
begin Y Y
call Y Y
comment Y Y
commit Y Y
copy into Y
create database Y Y
create file format Y Y
create function Y Y
create network policy Y Y
create or replace procedure Y Y
create or replace resource monitor Y Y
create or replace role Y Y
create or replace schema Y Y
create or replace secure view Y Y
create or replace sequence Y Y
create or replace share Y Y
create or replace stage Y Y
create or replace table Y Y
create or replace user Y Y
create or replace warehouse Y Y
create pipe Y Y
delete Y Y
desc file format Y
desc function Y
desc network policy Y
desc pipe Y
desc result Y
desc share Y
desc stage Y
desc table Y
desc user Y
desc view Y
drop database Y Y
drop file format Y Y
drop function Y Y
drop network policy Y Y
drop pipe Y Y
drop resource monitor Y Y
drop role Y Y
drop schema Y Y
drop share Y Y
drop stage Y Y
drop table Y Y
drop user Y Y
drop view Y Y
drop warehouse Y Y
get Y Y
grant Y Y
insert Y Y
list Y
merge Y Y
put Y
remove Y
revoke Y Y
rollback Y Y
select Y Y
set Y Y
show columns Y Y
show databases Y Y
show file formats Y Y
show functions Y Y
show grants Y Y
show locks Y
show network policies Y Y
show objects Y Y
show parameters Y Y
show pipes Y Y
show resource monitors Y Y
show roles Y Y
show schemas Y Y
show sequences Y Y
show shares Y Y
show stages Y Y
show tables Y Y
show transactions Y Y
show user functions Y Y
show users Y Y
show variables Y Y
show views Y Y
show warehouses Y Y
start transaction Y Y
truncate Y Y
undrop database Y
undrop schema Y
undrop table Y
unset Y
update Y Y
use Y


If you have any questions about General SQL Parser, You can always send us an email and we'll get back to you within 24 hours.


Any other benefits can I get by using this SQL Parser?

Yes, of course. We collect all kinds of examples in this page to illustrate how and why you want to use general sql parser, hope it can help you to make better use of this library.