-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into L028_autofix
- Loading branch information
Showing
3 changed files
with
250 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test/fixtures/dialects/spark3/create_table_complex_datatypes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--Create Table with complex datatypes | ||
CREATE TABLE table_identifier | ||
( a STRUCT<b: STRING, c: BOOLEAN>, d MAP<STRING, BOOLEAN>, e ARRAY<STRING>); | ||
|
||
--Create Table with complex datatypes and comments | ||
CREATE TABLE table_identifier | ||
( a STRUCT<b: STRING COMMENT 'struct_comment', c: BOOLEAN> COMMENT 'col_comment', d MAP<STRING, BOOLEAN> COMMENT 'col_comment', e ARRAY<STRING> COMMENT 'col_comment'); | ||
|
||
--Create Table with nested complex datatypes | ||
CREATE TABLE table_identifier | ||
( a STRUCT<b: STRING, c: MAP<STRING, BOOLEAN>>, d MAP<STRING, STRUCT<e: STRING, f: MAP<STRING, BOOLEAN>>>, g ARRAY<STRUCT<h: STRING, i: MAP<STRING, BOOLEAN>>>); |
216 changes: 216 additions & 0 deletions
216
test/fixtures/dialects/spark3/create_table_complex_datatypes.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
# YML test files are auto-generated from SQL files and should not be edited by | ||
# hand. To help enforce this, the "hash" field in the file must match a hash | ||
# computed by SQLFluff when running the tests. Please run | ||
# `python test/generate_parse_fixture_yml.py` to generate them after adding or | ||
# altering SQL files. | ||
_hash: 7e2cde585ebd2449087447234f57d697481af4f5ded4d07695f8641650b997fa | ||
file: | ||
- statement: | ||
create_table_statement: | ||
- keyword: CREATE | ||
- keyword: TABLE | ||
- table_reference: | ||
identifier: table_identifier | ||
- bracketed: | ||
- start_bracket: ( | ||
- column_definition: | ||
identifier: a | ||
data_type: | ||
- keyword: STRUCT | ||
- start_angle_bracket: < | ||
- identifier: b | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: STRING | ||
- comma: ',' | ||
- identifier: c | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
- end_angle_bracket: '>' | ||
- comma: ',' | ||
- column_definition: | ||
identifier: d | ||
data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
end_angle_bracket: '>' | ||
- comma: ',' | ||
- column_definition: | ||
identifier: e | ||
data_type: | ||
keyword: ARRAY | ||
start_angle_bracket: < | ||
data_type: | ||
primitive_type: | ||
keyword: STRING | ||
end_angle_bracket: '>' | ||
- end_bracket: ) | ||
- statement_terminator: ; | ||
- statement: | ||
create_table_statement: | ||
- keyword: CREATE | ||
- keyword: TABLE | ||
- table_reference: | ||
identifier: table_identifier | ||
- bracketed: | ||
- start_bracket: ( | ||
- column_definition: | ||
identifier: a | ||
data_type: | ||
- keyword: STRUCT | ||
- start_angle_bracket: < | ||
- identifier: b | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: STRING | ||
- keyword: COMMENT | ||
- literal: "'struct_comment'" | ||
- comma: ',' | ||
- identifier: c | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
- end_angle_bracket: '>' | ||
column_constraint_segment: | ||
comment_clause: | ||
keyword: COMMENT | ||
literal: "'col_comment'" | ||
- comma: ',' | ||
- column_definition: | ||
identifier: d | ||
data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
end_angle_bracket: '>' | ||
column_constraint_segment: | ||
comment_clause: | ||
keyword: COMMENT | ||
literal: "'col_comment'" | ||
- comma: ',' | ||
- column_definition: | ||
identifier: e | ||
data_type: | ||
keyword: ARRAY | ||
start_angle_bracket: < | ||
data_type: | ||
primitive_type: | ||
keyword: STRING | ||
end_angle_bracket: '>' | ||
column_constraint_segment: | ||
comment_clause: | ||
keyword: COMMENT | ||
literal: "'col_comment'" | ||
- end_bracket: ) | ||
- statement_terminator: ; | ||
- statement: | ||
create_table_statement: | ||
- keyword: CREATE | ||
- keyword: TABLE | ||
- table_reference: | ||
identifier: table_identifier | ||
- bracketed: | ||
- start_bracket: ( | ||
- column_definition: | ||
identifier: a | ||
data_type: | ||
- keyword: STRUCT | ||
- start_angle_bracket: < | ||
- identifier: b | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: STRING | ||
- comma: ',' | ||
- identifier: c | ||
- colon: ':' | ||
- data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
end_angle_bracket: '>' | ||
- end_angle_bracket: '>' | ||
- comma: ',' | ||
- column_definition: | ||
identifier: d | ||
data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
- keyword: STRUCT | ||
- start_angle_bracket: < | ||
- identifier: e | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: STRING | ||
- comma: ',' | ||
- identifier: f | ||
- colon: ':' | ||
- data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
end_angle_bracket: '>' | ||
- end_angle_bracket: '>' | ||
end_angle_bracket: '>' | ||
- comma: ',' | ||
- column_definition: | ||
identifier: g | ||
data_type: | ||
keyword: ARRAY | ||
start_angle_bracket: < | ||
data_type: | ||
- keyword: STRUCT | ||
- start_angle_bracket: < | ||
- identifier: h | ||
- colon: ':' | ||
- data_type: | ||
primitive_type: | ||
keyword: STRING | ||
- comma: ',' | ||
- identifier: i | ||
- colon: ':' | ||
- data_type: | ||
keyword: MAP | ||
start_angle_bracket: < | ||
primitive_type: | ||
keyword: STRING | ||
comma: ',' | ||
data_type: | ||
primitive_type: | ||
keyword: BOOLEAN | ||
end_angle_bracket: '>' | ||
- end_angle_bracket: '>' | ||
end_angle_bracket: '>' | ||
- end_bracket: ) | ||
- statement_terminator: ; |