diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0248f9d..2efa568 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,4 @@ -**v1.2.0** +**v1.2.1** ### Fixes MySQL: 1. Fixed issue relative to auto_increment that caused empty output if auto_increment defined in table properties - diff --git a/README.md b/README.md index 902e142..b94b1ba 100644 --- a/README.md +++ b/README.md @@ -486,7 +486,7 @@ for help with debugging & testing support for BigQuery dialect DDLs: ## Changelog -**v1.2.0** +**v1.2.1** ### Fixes MySQL: 1. Fixed issue relative to auto_increment that caused empty output if auto_increment defined in table properties - diff --git a/docs/README.rst b/docs/README.rst index 394b31a..75c2b99 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -549,7 +549,7 @@ for help with debugging & testing support for BigQuery dialect DDLs: Changelog --------- -**v1.2.0** +**v1.2.1** Fixes ^^^^^ diff --git a/pyproject.toml b/pyproject.toml index f1f3d75..1c01f3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "simple-ddl-parser" -version = "1.2.0" +version = "1.2.1" description = "Simple DDL Parser to parse SQL & dialects like HQL, TSQL (MSSQL), Oracle, AWS Redshift, Snowflake, MySQL, PostgreSQL, etc ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc.; sequences, alters, custom types & other entities from ddl." authors = ["Iuliia Volkova "] license = "MIT" diff --git a/simple_ddl_parser/parsetab.py b/simple_ddl_parser/parsetab.py index 00be1df..6418921 100644 --- a/simple_ddl_parser/parsetab.py +++ b/simple_ddl_parser/parsetab.py @@ -5,7 +5,7 @@ _lr_method = "LALR" -_lr_signature = "ADD ALTER ARRAY AS AUTOINCREMENT AUTO_REFRESH BY CACHE CATALOG CHANGE_TRACKING CHECK CLONE CLUSTER CLUSTERED COLLATE COLLECTION COLUMN COMMA COMMAT COMMENT CONSTRAINT CREATE DATABASE DATA_RETENTION_TIME_IN_DAYS DEFAULT DEFERRABLE DELETE DOMAIN DOT DQ_STRING DROP ENCODE ENCRYPT ENFORCED ENGINE EXISTS FILE_FORMAT FOR FOREIGN FORMAT GENERATED ID IF INCREMENT INDEX INHERITS INITIALLY INTO INVISIBLE ITEMS KEY KEYS LIKE LOCATION LP LT MAP MASKING MAXVALUE MAX_DATA_EXTENSION_TIME_IN_DAYS MINVALUE MODIFY NO NOORDER NOT NULL ON OPTIONS OR ORDER PARTITION PARTITIONED POLICY PRIMARY REFERENCES RENAME REPLACE ROW RP RT SALT SCHEMA SEQUENCE SERDE SERDEPROPERTIES SKEWED STAGE_FILE_FORMAT START STORAGE STORED STRING_BASE TABLE TABLESPACE TABLE_FORMAT TAG TBLPROPERTIES TERMINATED TEXTIMAGE_ON TYPE UNIQUE UPDATE USING VISIBLE WITHexpr : expr multiple_optionsexpr : expr INDEX id idalter_column_sql_server : alt_table ALTER COLUMN defcolumnexpr : expr ENGINE id idexpr : expr id LP id RPexpr : expr usingmultiple_options : options\n | multiple_options options\n expr : expr LOCATION STRING\n | expr LOCATION DQ_STRING\n | expr LOCATION table_property_equalsalter_column_modify_oracle : alt_table MODIFY defcolumnexpr : expr INHERITS LP t_name RPclone : CLONE idusing : USING idpkey_constraint : constraint pkey_statement id LP index_pid RP\n | constraint pkey_statement LP index_pid RP\n | pkey_constraint with\n | pkey_constraint with ON id\n on_update : ON UPDATE id\n | ON UPDATE STRING\n | ON UPDATE f_call\n encode : ENCODE idexpr : expr PARTITION BY LP pid RP\n | expr PARTITION BY id LP pid RP\n | expr PARTITION BY pid\n | expr PARTITION BY id pidencrypt : ENCRYPT\n | encrypt NO SALT\n | encrypt SALT\n | encrypt USING STRING\n | encrypt STRING\n expr : expr cluster_byexpr : expr ID ON LP pid RP\n | expr ID by_smthgexpr : expr id id\n | expr id KEY\n options : OPTIONS LP id_equals RPcluster_by : CLUSTER BY LP pid RP\n | CLUSTER BY pid\n expr : expr INTO ID IDmulti_id_or_string : id_or_string\n | multi_id_or_string id_or_string\n | f_call\n | multi_id_or_string f_call\n expr : expr id id LP pid RPwith : WITH with_argsexpr : expr database_baserow_format : ROW FORMAT SERDE\n | ROW FORMAT\n database_base : CREATE DATABASE id\n | CREATE ID DATABASE id\n | database_base clone\n equals : id id id\n | id id ON\n | id id id DOT id\n expr : expr row_format id\n | expr row_format STRING\n storage : STORAGE LP\n | storage id id\n | storage id id RP\n fmt_equals : id LP multi_id_or_string RPwith_args : LP equals\n | with_args COMMA equals\n | with_args with_args\n | with_args RP\n expr : expr WITH SERDEPROPERTIES multi_assignmentstable_property_equals : id id id_or_string\n | id id_or_string\n | id DOT id_or_string\n | id DOT id DOT id_or_string\n | LP id id id_or_string RP\n | LP id_or_string RP\n | id table_property_equals\n | id_equals\n expr : expr storageexpr : expr TBLPROPERTIES multi_assignmentsexpr : expr ID INDEXperiod_for : id FOR id LP pid RPtable_property_equals_int : id id id_or_string\n | id id_or_string\n | LP id id id_or_string RP\n | LP id_or_string RP\n multi_assignments : LP assignment\n | multi_assignments RP\n | multi_assignments COMMA assignment generated_by : GENERATED BY DEFAULT ON NULL AS ID\n | GENERATED BY ID AS ID\n | GENERATED BY DEFAULT AS IDexpr : expr ON idassignment : id id id\n | STRING id STRING\n | id id STRING\n | STRING id id\n | STRING idexpr : expr withtable_property_equals_bool : id id id_or_string\n | id id_or_string\n expr : expr TEXTIMAGE_ON idexpr : CREATE TABLESPACE id properties\n | CREATE id TABLESPACE id properties\n | CREATE id TABLESPACE id\n | CREATE TABLESPACE id\n | CREATE id id TABLESPACE id\n | CREATE id id TABLESPACE id properties\n expr : expr DATA_RETENTION_TIME_IN_DAYS table_property_equals_intexpr : expr COMMENT STRINGexpr : expr MAX_DATA_EXTENSION_TIME_IN_DAYS table_property_equalsexpr : expr id TERMINATED BY id\n | expr id TERMINATED BY STRING\n properties : property\n | properties propertyexpr : expr CHANGE_TRACKING table_property_equals_boolexpr : expr MAP KEYS TERMINATED BY id\n | expr MAP KEYS TERMINATED BY STRING\n expr : expr option_commentproperty : id id\n | id STRING\n | id ON\n | id STORAGE\n | id ROW\n option_comment : ID STRING\n | ID DQ_STRING\n | COMMENT ID STRING\n | COMMENT ID DQ_STRING\n | option_comment_equals\n expr : expr SKEWED BY LP id RP ON LP pid RPexpr : expr COLLECTION ITEMS TERMINATED BY id\n | expr COLLECTION ITEMS TERMINATED BY STRING\n option_comment_equals : STRING\n | option_comment_equals DQ_STRING\n create_table : CREATE TABLE IF NOT EXISTS\n | CREATE TABLE\n | CREATE OR REPLACE TABLE IF NOT EXISTS\n | CREATE OR REPLACE TABLE\n | CREATE id TABLE IF NOT EXISTS\n | CREATE id TABLE\n | CREATE OR REPLACE id TABLE IF NOT EXISTS\n | CREATE OR REPLACE id TABLE\n\n expr : expr STORED AS id\n | expr STORED AS id STRING\n | expr STORED AS id STRING id STRING\n expr : expr option_with_tagtag_equals : id id id_or_string\n | id id_or_string\n | id DOT id id id_or_string\n | id DOT id id_or_string\n | id DOT id DOT id id id_or_string\n | id DOT id DOT id id_or_string\n expr : expr PARTITIONED BY pid_with_type\n | expr PARTITIONED BY LP pid RP\n | expr PARTITIONED BY LP multiple_funct RP\n multiple_tag_equals : tag_equals\n | multiple_tag_equals COMMA tag_equals\n pid_with_type : LP column\n | pid_with_type COMMA column\n | pid_with_type RP\n c_property : id idoption_order_noorder : ORDER\n | NOORDER\n option_with_tag : TAG LP id RP\n | TAG LP id DOT id DOT id RP\n | TAG LP multiple_tag_equals RP\n | WITH TAG LP id RP\n | WITH TAG LP id DOT id DOT id RP\n | WITH TAG LP multiple_tag_equals RP\n option_with_masking_policy : MASKING POLICY id DOT id DOT id\n | WITH MASKING POLICY id DOT id DOT id\n expr : expr CATALOG table_property_equalsexpr : expr FILE_FORMAT fmt_equalsexpr : expr STAGE_FILE_FORMAT fmt_equalsc_type : id\n | id id\n | id id id id\n | id id id\n | c_type pid\n | id DOT id\n | tid\n | ARRAY\n | c_type ARRAY\n | c_type tid\n expr : expr TABLE_FORMAT table_property_equalsexpr : expr AUTO_REFRESH table_property_equals_boolas_virtual : AS LP id LP id LP pid RP COMMA pid RP RP\n | AS LP id LP pid RP RP\n | AS LP multi_id RPid : ID\n | DQ_STRINGid_or_string : id\n | STRINGSTRING : STRING_BASE\n | STRING STRING_BASE\n column : id c_type\n | column comment\n | column LP id RP\n | column LP id id RP\n | column LP id RP c_type\n | column LP id COMMA id RP\n | column LP id COMMA id RP c_type\n autoincrement : AUTOINCREMENTdefcolumn : column\n | defcolumn comment\n | defcolumn encode\n | defcolumn PRIMARY KEY\n | defcolumn UNIQUE KEY\n | defcolumn UNIQUE\n | defcolumn check_ex\n | defcolumn default\n | defcolumn collate\n | defcolumn enforced\n | defcolumn ref\n | defcolumn null\n | defcolumn ref null\n | defcolumn foreign ref\n | defcolumn encrypt\n | defcolumn generated\n | defcolumn c_property\n | defcolumn on_update\n | defcolumn options\n | defcolumn autoincrement\n | defcolumn option_order_noorder\n | defcolumn option_with_tag\n | defcolumn option_with_masking_policy\n | defcolumn as_virtual\n | defcolumn constraint\n | defcolumn generated_by\n check_ex : check_st\n | constraint check_st\n expr : create_schema\n | create_database\n | expr id\n | expr clone\n c_schema : CREATE SCHEMA\n | CREATE ID SCHEMA\n | CREATE OR REPLACE SCHEMAcreate_schema : c_schema id id\n | c_schema id id id\n | c_schema id\n | c_schema id DOT id\n | c_schema IF NOT EXISTS id\n | c_schema IF NOT EXISTS id DOT id\n | create_schema id id id\n | create_schema id id STRING\n | create_schema options\n create_database : database_base\n | create_database id id id\n | create_database id id STRING\n | create_database options\n expr : DROP TABLE id\n | DROP TABLE id DOT id\n multiple_column_names : column\n | multiple_column_names COMMA\n | multiple_column_names column\n type_definition : type_name id LP pid RP\n | type_name id LP multiple_column_names RP\n | type_name LP id_equals RP\n | type_name TABLE LP defcolumn\n | type_definition COMMA defcolumn\n | type_definition RP\n expr : type_definitiontype_name : type_create id AS\n | type_create id DOT id AS\n | type_create id DOT id\n | type_create id\n type_create : CREATE TYPE\n | CREATE OR REPLACE TYPE\n expr : domain_name id LP pid RPdomain_name : CREATE DOMAIN id AS\n | CREATE DOMAIN id DOT id AS\n | CREATE DOMAIN id DOT id\n | CREATE DOMAIN id\n expr : alter_foreign ref\n | alter_drop_column\n | alter_check\n | alter_unique\n | alter_default\n | alter_primary_key\n | alter_primary_key using_tablespace\n | alter_column_add\n | alter_rename_column\n | alter_column_sql_server\n | alter_column_modify\n | alter_column_modify_oracle\n alter_column_modify : alt_table MODIFY COLUMN defcolumnalter_drop_column : alt_table DROP COLUMN idalter_rename_column : alt_table RENAME COLUMN id id idalter_column_add : alt_table ADD defcolumnalter_primary_key : alt_table ADD PRIMARY KEY LP pid RP\n | alt_table ADD constraint PRIMARY KEY LP pid RP\n alter_unique : alt_table ADD UNIQUE LP pid RP\n | alt_table ADD constraint UNIQUE LP pid RP\n alter_default : alt_table id id\n | alt_table ADD constraint id id\n | alt_table ADD id STRING\n | alt_table ADD constraint id STRING\n | alter_default id\n | alter_default FOR pid\n alter_check : alt_table ADD check_st\n | alt_table ADD constraint check_st\n alter_foreign : alt_table ADD foreign\n | alt_table ADD constraint foreign\n alt_table : ALTER TABLE t_name\n | ALTER TABLE IF EXISTS t_name\n | ALTER TABLE ID t_nameid_equals : id id id_or_string\n | id id_or_string\n | id_equals COMMA\n | id_equals COMMA id id id_or_string\n | id\n | id_equals LP pid RP\n | id_equals LP pid RP id\n | id_equals COMMA id id\n | id_equals COMMA id\n expr : index_table_name LP index_pid RPindex_table_name : create_index ON id\n | create_index ON id DOT id\n c_index : INDEX LP index_pid RP\n | INDEX id LP index_pid RP\n | c_index INVISIBLE\n | c_index VISIBLEcreate_index : CREATE INDEX id\n | CREATE UNIQUE INDEX id\n | create_index ON id\n | CREATE CLUSTERED INDEX id\n expr : table_name defcolumn\n | table_name LP defcolumn\n | table_name\n | table_name LP RP\n | table_name cluster_by LP defcolumn\n | expr COMMA defcolumn\n | expr COMMA c_index\n | expr COMMA\n | expr COMMA constraint\n | expr COMMA check_ex\n | expr COMMA foreign\n | expr COMMA pkey\n | expr COMMA uniq\n | expr COMMA statem_by_id\n | expr COMMA constraint uniq\n | expr COMMA period_for\n | expr COMMA pkey_constraint\n | expr COMMA constraint pkey\n | expr COMMA constraint pkey enforced\n | expr COMMA constraint foreign ref\n | expr COMMA foreign ref\n | expr encode\n | expr DEFAULT id id id\n | expr RP\n likke : LIKE\n | CLONE\n expr : table_name likke id\n | table_name likke id DOT id\n | table_name LP likke id DOT id RP\n | table_name LP likke id RP\n t_name : id DOT id\n | id\n | id DOT id DOT id\n table_name : create_table t_name\n | table_name likke id\n expr : seq_name\n | expr INCREMENT id\n | expr INCREMENT BY id\n | expr INCREMENT id id\n | expr START id\n | expr START WITH id\n | expr START id id\n | expr MINVALUE id\n | expr NO MINVALUE\n | expr NO MAXVALUE\n | expr MAXVALUE id\n | expr CACHE id\n | expr CACHE\n | expr NOORDER\n | expr ORDER\n seq_name : create_seq id DOT id\n | create_seq id\n create_seq : CREATE SEQUENCE IF NOT EXISTS\n | CREATE SEQUENCE\n\n tid : LT id\n | LT\n | tid LT\n | tid id\n | tid COMMAT\n | tid RT\n null : NULL\n | NOT NULL\n f_call : id LP RP\n | id LP f_call RP\n | id LP multi_id RP\n | id LP pid RP\n | id LP id AS id RP\n multi_id : id\n | multi_id id\n | f_call\n | multi_id f_call\n funct_args : LP multi_id RPfunct : id LP multi_id RPmultiple_funct : funct\n | multiple_funct COMMA funct\n | multiple_funct COMMA\n funct_expr : LP multi_id RP\n | multi_id\n dot_id : id DOT iddefault : DEFAULT id\n | DEFAULT STRING\n | DEFAULT NULL\n | default FOR dot_id\n | DEFAULT funct_expr\n | DEFAULT LP pid RP\n | DEFAULT LP funct_expr pid RP\n | default id\n | DEFAULT id DOT funct_expr\n | default LP RP\n enforced : ENFORCED\n | NOT ENFORCED\n collate : COLLATE id\n | COLLATE STRING\n \n constraint : CONSTRAINT id\n \n generated : gen_always funct_expr\n | gen_always funct_expr id\n | gen_always LP multi_id RP\n | gen_always f_call\n \n gen_always : GENERATED id AS\n check_st : CHECK LP id\n | check_st id\n | check_st STRING\n | check_st id STRING\n | check_st id RP\n | check_st STRING RP\n | check_st funct_args\n | CHECK LP id DOT id\n | check_st LP pid RP\n using_tablespace : USING INDEX tablespacepid : id\n | STRING\n | pid id\n | pid STRING\n | STRING LP RP\n | id LP RP\n | pid COMMA id\n | pid COMMA STRING\n index_pid : id\n | index_pid id\n | index_pid COMMA index_pid\n foreign : FOREIGN KEY LP pid RP\n | FOREIGN KEYref : REFERENCES t_name\n | ref LP pid RP\n | ref ON DELETE id\n | ref ON UPDATE id\n | ref DEFERRABLE INITIALLY id\n | ref NOT DEFERRABLE\n expr : pkeyuniq : UNIQUE LP pid RP\n | UNIQUE KEY id LP pid RP\n statem_by_id : id LP pid RP\n | id KEY LP pid RP\n pkey : pkey_statement LP pid RP\n | pkey_statement ID LP pid RP\n pkey_statement : PRIMARY KEYcomment : COMMENT STRINGtablespace : TABLESPACE id\n | TABLESPACE id properties\n expr : expr tablespaceby_smthg : BY id\n | BY ROW\n | BY LP pid RP\n " +_lr_signature = "ADD ALTER ARRAY AS AUTOINCREMENT AUTO_REFRESH BY CACHE CATALOG CHANGE_TRACKING CHECK CLONE CLUSTER CLUSTERED COLLATE COLLECTION COLUMN COMMA COMMAT COMMENT CONSTRAINT CREATE DATABASE DATA_RETENTION_TIME_IN_DAYS DEFAULT DEFERRABLE DELETE DOMAIN DOT DQ_STRING DROP ENCODE ENCRYPT ENFORCED ENGINE EXISTS FILE_FORMAT FOR FOREIGN FORMAT GENERATED ID IF INCREMENT INDEX INHERITS INITIALLY INTO INVISIBLE ITEMS KEY KEYS LIKE LOCATION LP LT MAP MASKING MAXVALUE MAX_DATA_EXTENSION_TIME_IN_DAYS MINVALUE MODIFY NO NOORDER NOT NULL ON OPTIONS OR ORDER PARTITION PARTITIONED POLICY PRIMARY REFERENCES RENAME REPLACE ROW RP RT SALT SCHEMA SEQUENCE SERDE SERDEPROPERTIES SKEWED STAGE_FILE_FORMAT START STORAGE STORED STRING_BASE TABLE TABLESPACE TABLE_FORMAT TAG TBLPROPERTIES TERMINATED TEXTIMAGE_ON TYPE UNIQUE UPDATE USING VISIBLE WITHexpr : expr multiple_optionsexpr : expr INDEX id idalter_column_sql_server : alt_table ALTER COLUMN defcolumnexpr : expr ENGINE id idexpr : expr id LP id RPexpr : expr usingmultiple_options : options\n | multiple_options options\n expr : expr LOCATION STRING\n | expr LOCATION DQ_STRING\n | expr LOCATION table_property_equalsalter_column_modify_oracle : alt_table MODIFY defcolumnexpr : expr INHERITS LP t_name RPclone : CLONE idusing : USING idpkey_constraint : constraint pkey_statement id LP index_pid RP\n | constraint pkey_statement LP index_pid RP\n | pkey_constraint with\n | pkey_constraint with ON id\n on_update : ON UPDATE id\n | ON UPDATE STRING\n | ON UPDATE f_call\n encode : ENCODE idexpr : expr PARTITION BY LP pid RP\n | expr PARTITION BY id LP pid RP\n | expr PARTITION BY pid\n | expr PARTITION BY id pidencrypt : ENCRYPT\n | encrypt NO SALT\n | encrypt SALT\n | encrypt USING STRING\n | encrypt STRING\n expr : expr cluster_byexpr : expr ID ON LP pid RP\n | expr ID by_smthgexpr : expr id id\n | expr id KEY\n options : OPTIONS LP id_equals RPcluster_by : CLUSTER BY LP pid RP\n | CLUSTER BY pid\n expr : expr INTO ID IDmulti_id_or_string : id_or_string\n | multi_id_or_string id_or_string\n | f_call\n | multi_id_or_string f_call\n expr : expr id id LP pid RPwith : WITH with_argsexpr : expr database_baserow_format : ROW FORMAT SERDE\n | ROW FORMAT\n database_base : CREATE DATABASE id\n | CREATE ID DATABASE id\n | database_base clone\n equals : id id id\n | id id ON\n | id id id DOT id\n expr : expr row_format id\n | expr row_format STRING\n storage : STORAGE LP\n | storage id id\n | storage id id RP\n fmt_equals : id LP multi_id_or_string RPwith_args : LP equals\n | with_args COMMA equals\n | with_args with_args\n | with_args RP\n expr : expr WITH SERDEPROPERTIES multi_assignmentstable_property_equals : id id id_or_string\n | id id_or_string\n | id DOT id_or_string\n | id DOT id DOT id_or_string\n | LP id id id_or_string RP\n | LP id_or_string RP\n | id table_property_equals\n | id_equals\n expr : expr storageexpr : expr TBLPROPERTIES multi_assignmentsexpr : expr ID INDEXperiod_for : id FOR id LP pid RPtable_property_equals_int : id id id_or_string\n | id id_or_string\n | LP id id id_or_string RP\n | LP id_or_string RP\n multi_assignments : LP assignment\n | multi_assignments RP\n | multi_assignments COMMA assignmentgenerated_by : GENERATED BY DEFAULT ON NULL AS ID\n | GENERATED BY ID AS ID\n | GENERATED BY DEFAULT AS IDexpr : expr ON idassignment : id id id\n | STRING id STRING\n | id id STRING\n | STRING id id\n | STRING idexpr : expr withtable_property_equals_bool : id id id_or_string\n | id id_or_string\n expr : expr TEXTIMAGE_ON idexpr : CREATE TABLESPACE id properties\n | CREATE id TABLESPACE id properties\n | CREATE id TABLESPACE id\n | CREATE TABLESPACE id\n | CREATE id id TABLESPACE id\n | CREATE id id TABLESPACE id properties\n expr : expr DATA_RETENTION_TIME_IN_DAYS table_property_equals_intexpr : expr COMMENT STRINGexpr : expr MAX_DATA_EXTENSION_TIME_IN_DAYS table_property_equalsexpr : expr id TERMINATED BY id\n | expr id TERMINATED BY STRING\n properties : property\n | properties propertyexpr : expr CHANGE_TRACKING table_property_equals_boolexpr : expr MAP KEYS TERMINATED BY id\n | expr MAP KEYS TERMINATED BY STRING\n expr : expr option_commentproperty : id id\n | id STRING\n | id ON\n | id STORAGE\n | id ROW\n option_comment : ID STRING\n | ID DQ_STRING\n | COMMENT ID STRING\n | COMMENT ID DQ_STRING\n | option_comment_equals\n expr : expr SKEWED BY LP id RP ON LP pid RPexpr : expr COLLECTION ITEMS TERMINATED BY id\n | expr COLLECTION ITEMS TERMINATED BY STRING\n option_comment_equals : STRING\n | option_comment_equals DQ_STRING\n create_table : CREATE TABLE IF NOT EXISTS\n | CREATE TABLE\n | CREATE OR REPLACE TABLE IF NOT EXISTS\n | CREATE OR REPLACE TABLE\n | CREATE id TABLE IF NOT EXISTS\n | CREATE id TABLE\n | CREATE OR REPLACE id TABLE IF NOT EXISTS\n | CREATE OR REPLACE id TABLE\n\n expr : expr STORED AS id\n | expr STORED AS id STRING\n | expr STORED AS id STRING id STRING\n expr : expr option_with_tagtag_equals : id id id_or_string\n | id id_or_string\n | id DOT id id id_or_string\n | id DOT id id_or_string\n | id DOT id DOT id id id_or_string\n | id DOT id DOT id id_or_string\n expr : expr PARTITIONED BY pid_with_type\n | expr PARTITIONED BY LP pid RP\n | expr PARTITIONED BY LP multiple_funct RP\n multiple_tag_equals : tag_equals\n | multiple_tag_equals COMMA tag_equals\n pid_with_type : LP column\n | pid_with_type COMMA column\n | pid_with_type RP\n c_property : id idoption_order_noorder : ORDER\n | NOORDER\n option_with_tag : TAG LP id RP\n | TAG LP id DOT id DOT id RP\n | TAG LP multiple_tag_equals RP\n | WITH TAG LP id RP\n | WITH TAG LP id DOT id DOT id RP\n | WITH TAG LP multiple_tag_equals RP\n option_with_masking_policy : MASKING POLICY id DOT id DOT id\n | WITH MASKING POLICY id DOT id DOT id\n expr : expr CATALOG table_property_equalsexpr : expr FILE_FORMAT fmt_equalsexpr : expr STAGE_FILE_FORMAT fmt_equalsc_type : id\n | id id\n | id id id id\n | id id id\n | c_type pid\n | id DOT id\n | tid\n | ARRAY\n | c_type ARRAY\n | c_type tid\n expr : expr TABLE_FORMAT table_property_equalsexpr : expr AUTO_REFRESH table_property_equals_boolas_virtual : AS LP id LP id LP pid RP COMMA pid RP RP\n | AS LP id LP pid RP RP\n | AS LP multi_id RPid : ID\n | DQ_STRINGid_or_string : id\n | STRINGSTRING : STRING_BASE\n | STRING STRING_BASE\n column : id c_type\n | column comment\n | column LP id RP\n | column LP id id RP\n | column LP id RP c_type\n | column LP id COMMA id RP\n | column LP id COMMA id RP c_type\n autoincrement : AUTOINCREMENTdefcolumn : column\n | defcolumn comment\n | defcolumn encode\n | defcolumn PRIMARY KEY\n | defcolumn UNIQUE KEY\n | defcolumn UNIQUE\n | defcolumn check_ex\n | defcolumn default\n | defcolumn collate\n | defcolumn enforced\n | defcolumn ref\n | defcolumn null\n | defcolumn ref null\n | defcolumn foreign ref\n | defcolumn encrypt\n | defcolumn generated\n | defcolumn c_property\n | defcolumn on_update\n | defcolumn options\n | defcolumn autoincrement\n | defcolumn option_order_noorder\n | defcolumn option_with_tag\n | defcolumn option_with_masking_policy\n | defcolumn as_virtual\n | defcolumn constraint\n | defcolumn generated_by\n check_ex : check_st\n | constraint check_st\n expr : create_schema\n | create_database\n | expr id\n | expr clone\n c_schema : CREATE SCHEMA\n | CREATE ID SCHEMA\n | CREATE OR REPLACE SCHEMAcreate_schema : c_schema id id\n | c_schema id id id\n | c_schema id\n | c_schema id DOT id\n | c_schema IF NOT EXISTS id\n | c_schema IF NOT EXISTS id DOT id\n | create_schema id id id\n | create_schema id id STRING\n | create_schema options\n create_database : database_base\n | create_database id id id\n | create_database id id STRING\n | create_database options\n expr : DROP TABLE id\n | DROP TABLE id DOT id\n multiple_column_names : column\n | multiple_column_names COMMA\n | multiple_column_names column\n type_definition : type_name id LP pid RP\n | type_name id LP multiple_column_names RP\n | type_name LP id_equals RP\n | type_name TABLE LP defcolumn\n | type_definition COMMA defcolumn\n | type_definition RP\n expr : type_definitiontype_name : type_create id AS\n | type_create id DOT id AS\n | type_create id DOT id\n | type_create id\n type_create : CREATE TYPE\n | CREATE OR REPLACE TYPE\n expr : domain_name id LP pid RPdomain_name : CREATE DOMAIN id AS\n | CREATE DOMAIN id DOT id AS\n | CREATE DOMAIN id DOT id\n | CREATE DOMAIN id\n expr : alter_foreign ref\n | alter_drop_column\n | alter_check\n | alter_unique\n | alter_default\n | alter_primary_key\n | alter_primary_key using_tablespace\n | alter_column_add\n | alter_rename_column\n | alter_column_sql_server\n | alter_column_modify\n | alter_column_modify_oracle\n alter_column_modify : alt_table MODIFY COLUMN defcolumnalter_drop_column : alt_table DROP COLUMN idalter_rename_column : alt_table RENAME COLUMN id id idalter_column_add : alt_table ADD defcolumnalter_primary_key : alt_table ADD PRIMARY KEY LP pid RP\n | alt_table ADD constraint PRIMARY KEY LP pid RP\n alter_unique : alt_table ADD UNIQUE LP pid RP\n | alt_table ADD constraint UNIQUE LP pid RP\n alter_default : alt_table id id\n | alt_table ADD constraint id id\n | alt_table ADD id STRING\n | alt_table ADD constraint id STRING\n | alter_default id\n | alter_default FOR pid\n alter_check : alt_table ADD check_st\n | alt_table ADD constraint check_st\n alter_foreign : alt_table ADD foreign\n | alt_table ADD constraint foreign\n alt_table : ALTER TABLE t_name\n | ALTER TABLE IF EXISTS t_name\n | ALTER TABLE ID t_nameid_equals : id id id_or_string\n | id id_or_string\n | id_equals COMMA\n | id_equals COMMA id id id_or_string\n | id\n | id_equals LP pid RP\n | id_equals LP pid RP id\n | id_equals COMMA id id\n | id_equals COMMA id\n expr : index_table_name LP index_pid RPindex_table_name : create_index ON id\n | create_index ON id DOT id\n c_index : INDEX LP index_pid RP\n | INDEX id LP index_pid RP\n | c_index INVISIBLE\n | c_index VISIBLEcreate_index : CREATE INDEX id\n | CREATE UNIQUE INDEX id\n | create_index ON id\n | CREATE CLUSTERED INDEX id\n expr : table_name defcolumn\n | table_name LP defcolumn\n | table_name\n | table_name LP RP\n | table_name cluster_by LP defcolumn\n | expr COMMA defcolumn\n | expr COMMA c_index\n | expr COMMA\n | expr COMMA constraint\n | expr COMMA check_ex\n | expr COMMA foreign\n | expr COMMA pkey\n | expr COMMA uniq\n | expr COMMA statem_by_id\n | expr COMMA constraint uniq\n | expr COMMA period_for\n | expr COMMA pkey_constraint\n | expr COMMA constraint pkey\n | expr COMMA constraint pkey enforced\n | expr COMMA constraint foreign ref\n | expr COMMA foreign ref\n | expr encode\n | expr DEFAULT id id id\n | expr RP\n likke : LIKE\n | CLONE\n expr : table_name likke id\n | table_name likke id DOT id\n | table_name LP likke id DOT id RP\n | table_name LP likke id RP\n t_name : id DOT id\n | id\n | id DOT id DOT id\n table_name : create_table t_name\n | table_name likke id\n expr : seq_name\n | expr INCREMENT id\n | expr INCREMENT BY id\n | expr INCREMENT id id\n | expr START id\n | expr START WITH id\n | expr START id id\n | expr MINVALUE id\n | expr NO MINVALUE\n | expr NO MAXVALUE\n | expr MAXVALUE id\n | expr CACHE id\n | expr CACHE\n | expr NOORDER\n | expr ORDER\n seq_name : create_seq id DOT id\n | create_seq id\n create_seq : CREATE SEQUENCE IF NOT EXISTS\n | CREATE SEQUENCE\n\n tid : LT id\n | LT\n | tid LT\n | tid id\n | tid COMMAT\n | tid RT\n null : NULL\n | NOT NULL\n f_call : id LP RP\n | id LP f_call RP\n | id LP multi_id RP\n | id LP pid RP\n | id LP id AS id RP\n multi_id : id\n | multi_id id\n | f_call\n | multi_id f_call\n funct_args : LP multi_id RPfunct : id LP multi_id RPmultiple_funct : funct\n | multiple_funct COMMA funct\n | multiple_funct COMMA\n funct_expr : LP multi_id RP\n | multi_id\n dot_id : id DOT iddefault : DEFAULT id\n | DEFAULT STRING\n | DEFAULT NULL\n | default FOR dot_id\n | DEFAULT funct_expr\n | DEFAULT LP pid RP\n | DEFAULT LP funct_expr pid RP\n | default id\n | DEFAULT id DOT funct_expr\n | default LP RP\n enforced : ENFORCED\n | NOT ENFORCED\n collate : COLLATE id\n | COLLATE STRING\n \n constraint : CONSTRAINT id\n \n generated : gen_always funct_expr\n | gen_always funct_expr id\n | gen_always LP multi_id RP\n | gen_always f_call\n \n gen_always : GENERATED id AS\n check_st : CHECK LP id\n | check_st id\n | check_st STRING\n | check_st id STRING\n | check_st id RP\n | check_st STRING RP\n | check_st funct_args\n | CHECK LP id DOT id\n | check_st LP pid RP\n using_tablespace : USING INDEX tablespacepid : id\n | STRING\n | pid id\n | pid STRING\n | STRING LP RP\n | id LP RP\n | pid COMMA id\n | pid COMMA STRING\n index_pid : id\n | index_pid id\n | index_pid COMMA index_pid\n foreign : FOREIGN KEY LP pid RP\n | FOREIGN KEYref : REFERENCES t_name\n | ref LP pid RP\n | ref ON DELETE id\n | ref ON UPDATE id\n | ref DEFERRABLE INITIALLY id\n | ref NOT DEFERRABLE\n expr : pkeyuniq : UNIQUE LP pid RP\n | UNIQUE KEY id LP pid RP\n statem_by_id : id LP pid RP\n | id KEY LP pid RP\n pkey : pkey_statement LP pid RP\n | pkey_statement ID LP pid RP\n pkey_statement : PRIMARY KEYcomment : COMMENT STRINGtablespace : TABLESPACE id\n | TABLESPACE id properties\n expr : expr tablespaceby_smthg : BY id\n | BY ROW\n | BY LP pid RP\n " _lr_action_items = { "CREATE": ( @@ -52487,19 +52487,19 @@ "snowflake.py", 211, ), - ("id -> ID", "id", 1, "p_id", "ddl_parser.py", 240), - ("id -> DQ_STRING", "id", 1, "p_id", "ddl_parser.py", 241), - ("id_or_string -> id", "id_or_string", 1, "p_id_or_string", "ddl_parser.py", 252), + ("id -> ID", "id", 1, "p_id", "ddl_parser.py", 239), + ("id -> DQ_STRING", "id", 1, "p_id", "ddl_parser.py", 240), + ("id_or_string -> id", "id_or_string", 1, "p_id_or_string", "ddl_parser.py", 251), ( "id_or_string -> STRING", "id_or_string", 1, "p_id_or_string", "ddl_parser.py", - 253, + 252, ), - ("STRING -> STRING_BASE", "STRING", 1, "p_string", "ddl_parser.py", 257), - ("STRING -> STRING STRING_BASE", "STRING", 2, "p_string", "ddl_parser.py", 258), + ("STRING -> STRING_BASE", "STRING", 1, "p_string", "ddl_parser.py", 256), + ("STRING -> STRING STRING_BASE", "STRING", 2, "p_string", "ddl_parser.py", 257), ("column -> id c_type", "column", 2, "p_column", "sql.py", 314), ("column -> column comment", "column", 2, "p_column", "sql.py", 315), ("column -> column LP id RP", "column", 4, "p_column", "sql.py", 316), @@ -53322,19 +53322,19 @@ ("f_call -> id LP multi_id RP", "f_call", 4, "p_f_call", "sql.py", 1390), ("f_call -> id LP pid RP", "f_call", 4, "p_f_call", "sql.py", 1391), ("f_call -> id LP id AS id RP", "f_call", 6, "p_f_call", "sql.py", 1392), - ("multi_id -> id", "multi_id", 1, "p_multi_id", "sql.py", 1411), - ("multi_id -> multi_id id", "multi_id", 2, "p_multi_id", "sql.py", 1412), - ("multi_id -> f_call", "multi_id", 1, "p_multi_id", "sql.py", 1413), - ("multi_id -> multi_id f_call", "multi_id", 2, "p_multi_id", "sql.py", 1414), - ("funct_args -> LP multi_id RP", "funct_args", 3, "p_funct_args", "sql.py", 1425), - ("funct -> id LP multi_id RP", "funct", 4, "p_funct", "sql.py", 1429), + ("multi_id -> id", "multi_id", 1, "p_multi_id", "sql.py", 1410), + ("multi_id -> multi_id id", "multi_id", 2, "p_multi_id", "sql.py", 1411), + ("multi_id -> f_call", "multi_id", 1, "p_multi_id", "sql.py", 1412), + ("multi_id -> multi_id f_call", "multi_id", 2, "p_multi_id", "sql.py", 1413), + ("funct_args -> LP multi_id RP", "funct_args", 3, "p_funct_args", "sql.py", 1426), + ("funct -> id LP multi_id RP", "funct", 4, "p_funct", "sql.py", 1430), ( "multiple_funct -> funct", "multiple_funct", 1, "p_multiple_funct", "sql.py", - 1433, + 1434, ), ( "multiple_funct -> multiple_funct COMMA funct", @@ -53342,7 +53342,7 @@ 3, "p_multiple_funct", "sql.py", - 1434, + 1435, ), ( "multiple_funct -> multiple_funct COMMA", @@ -53350,40 +53350,40 @@ 2, "p_multiple_funct", "sql.py", - 1435, - ), - ("funct_expr -> LP multi_id RP", "funct_expr", 3, "p_funct_expr", "sql.py", 1444), - ("funct_expr -> multi_id", "funct_expr", 1, "p_funct_expr", "sql.py", 1445), - ("dot_id -> id DOT id", "dot_id", 3, "p_dot_id", "sql.py", 1453), - ("default -> DEFAULT id", "default", 2, "p_default", "sql.py", 1457), - ("default -> DEFAULT STRING", "default", 2, "p_default", "sql.py", 1458), - ("default -> DEFAULT NULL", "default", 2, "p_default", "sql.py", 1459), - ("default -> default FOR dot_id", "default", 3, "p_default", "sql.py", 1460), - ("default -> DEFAULT funct_expr", "default", 2, "p_default", "sql.py", 1461), - ("default -> DEFAULT LP pid RP", "default", 4, "p_default", "sql.py", 1462), + 1436, + ), + ("funct_expr -> LP multi_id RP", "funct_expr", 3, "p_funct_expr", "sql.py", 1445), + ("funct_expr -> multi_id", "funct_expr", 1, "p_funct_expr", "sql.py", 1446), + ("dot_id -> id DOT id", "dot_id", 3, "p_dot_id", "sql.py", 1454), + ("default -> DEFAULT id", "default", 2, "p_default", "sql.py", 1458), + ("default -> DEFAULT STRING", "default", 2, "p_default", "sql.py", 1459), + ("default -> DEFAULT NULL", "default", 2, "p_default", "sql.py", 1460), + ("default -> default FOR dot_id", "default", 3, "p_default", "sql.py", 1461), + ("default -> DEFAULT funct_expr", "default", 2, "p_default", "sql.py", 1462), + ("default -> DEFAULT LP pid RP", "default", 4, "p_default", "sql.py", 1463), ( "default -> DEFAULT LP funct_expr pid RP", "default", 5, "p_default", "sql.py", - 1463, - ), - ("default -> default id", "default", 2, "p_default", "sql.py", 1464), - ("default -> DEFAULT id DOT funct_expr", "default", 4, "p_default", "sql.py", 1465), - ("default -> default LP RP", "default", 3, "p_default", "sql.py", 1466), - ("enforced -> ENFORCED", "enforced", 1, "p_enforced", "sql.py", 1513), - ("enforced -> NOT ENFORCED", "enforced", 2, "p_enforced", "sql.py", 1514), - ("collate -> COLLATE id", "collate", 2, "p_collate", "sql.py", 1520), - ("collate -> COLLATE STRING", "collate", 2, "p_collate", "sql.py", 1521), - ("constraint -> CONSTRAINT id", "constraint", 2, "p_constraint", "sql.py", 1528), + 1464, + ), + ("default -> default id", "default", 2, "p_default", "sql.py", 1465), + ("default -> DEFAULT id DOT funct_expr", "default", 4, "p_default", "sql.py", 1466), + ("default -> default LP RP", "default", 3, "p_default", "sql.py", 1467), + ("enforced -> ENFORCED", "enforced", 1, "p_enforced", "sql.py", 1514), + ("enforced -> NOT ENFORCED", "enforced", 2, "p_enforced", "sql.py", 1515), + ("collate -> COLLATE id", "collate", 2, "p_collate", "sql.py", 1521), + ("collate -> COLLATE STRING", "collate", 2, "p_collate", "sql.py", 1522), + ("constraint -> CONSTRAINT id", "constraint", 2, "p_constraint", "sql.py", 1529), ( "generated -> gen_always funct_expr", "generated", 2, "p_generated", "sql.py", - 1537, + 1538, ), ( "generated -> gen_always funct_expr id", @@ -53391,7 +53391,7 @@ 3, "p_generated", "sql.py", - 1538, + 1539, ), ( "generated -> gen_always LP multi_id RP", @@ -53399,9 +53399,9 @@ 4, "p_generated", "sql.py", - 1539, + 1540, ), - ("generated -> gen_always f_call", "generated", 2, "p_generated", "sql.py", 1540), + ("generated -> gen_always f_call", "generated", 2, "p_generated", "sql.py", 1541), ("gen_always -> GENERATED id AS", "gen_always", 3, "p_gen_always", "sql.py", 1552), ("check_st -> CHECK LP id", "check_st", 3, "p_check_st", "sql.py", 1557), ("check_st -> check_st id", "check_st", 2, "p_check_st", "sql.py", 1558),