sqlfluff / sqlfluff

A modular SQL linter and auto-formatter with support for multiple dialects and templated code.

Home Page:https://www.sqlfluff.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snowflake Iceberg table and external volume creation linting issue.

DrishtiNishchhalSahu opened this issue · comments

Search before asking

  • I searched the issues and found no similar issues.

Description

While creating Iceberg Volume for Iceberg table we use below statements but currenlty SQLfluff is getting failed with Error -
L: 1 | P: 1 | PRS | Line 1, Position 1: Found unparsable section: 'CREATE ICEBERG TABLE dbname....'
L: 1 | P: 1 | PRS | Line 1, Position 1: Found unparsable section: 'CREATE EXTERNAL VOLUME iceberg_ext_vol...'

Below Snowflake sql is getting used to create external volume and icerberg table -
CREATE EXTERNAL VOLUME iceberg_ext_vol
STORAGE_LOCATIONS =
(
(
NAME = 'someregion'
STORAGE_PROVIDER = 'S3'
STORAGE_BASE_URL = 's3://somelocation'
STORAGE_AWS_ROLE_ARN = 'dummy'
)
);
Below statement is getting executed for creating iceberg table -
CREATE ICEBERG TABLE db.archival.iceberg_report_invoicesummary
(
value string,
partition_date date,
clientid string,
invoiceclientid string,
)
EXTERNAL_VOLUME='iceberg_ext_vol'
CATALOG='SNOWFLAKE'
BASE_LOCATION ='report_invoicesummary';

Use case

Let it get recognise Iceberg pattern of creating table in snowflake and validate it (Create table syntax for Iceberg table in snowflake i have shared it.)

Iceberg Keyword should get recognised while creating table along with below parameter value (create table syntax i have shared above)-
EXTERNAL_VOLUME='iceberg_ext_vol'
CATALOG='SNOWFLAKE'
BASE_LOCATION ='report_invoicesummary';

Dialect

Snowflake

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct