-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the support of MODIFY TTL syntax (#32)
- Loading branch information
Showing
8 changed files
with
152 additions
and
0 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
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
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 @@ | ||
ALTER TABLE infra.flow_processed_emails_local ON CLUSTER default_cluster REMOVE TTL; |
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 @@ | ||
ALTER TABLE infra.flow_processed_emails_local ON CLUSTER default_cluster MODIFY TTL created_at + INTERVAL 3 YEAR; |
7 changes: 7 additions & 0 deletions
7
parser/testdata/dml/format/alter_table_with_modify_remove_ttl.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,7 @@ | ||
-- Origin SQL: | ||
ALTER TABLE infra.flow_processed_emails_local ON CLUSTER default_cluster REMOVE TTL; | ||
|
||
-- Format SQL: | ||
ALTER TABLE infra.flow_processed_emails_local | ||
ON CLUSTER default_cluster | ||
REMOVE TTL; |
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,7 @@ | ||
-- Origin SQL: | ||
ALTER TABLE infra.flow_processed_emails_local ON CLUSTER default_cluster MODIFY TTL created_at + INTERVAL 3 YEAR; | ||
|
||
-- Format SQL: | ||
ALTER TABLE infra.flow_processed_emails_local | ||
ON CLUSTER default_cluster | ||
MODIFY TTL created_at + INTERVAL 3 YEAR; |
35 changes: 35 additions & 0 deletions
35
parser/testdata/dml/output/alter_table_with_modify_remove_ttl.sql.golden.json
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,35 @@ | ||
[ | ||
{ | ||
"AlterPos": 0, | ||
"StatementEnd": 83, | ||
"TableIdentifier": { | ||
"Database": { | ||
"Name": "infra", | ||
"Unquoted": false, | ||
"NamePos": 12, | ||
"NameEnd": 17 | ||
}, | ||
"Table": { | ||
"Name": "flow_processed_emails_local", | ||
"Unquoted": false, | ||
"NamePos": 18, | ||
"NameEnd": 45 | ||
} | ||
}, | ||
"OnCluster": { | ||
"OnPos": 46, | ||
"Expr": { | ||
"Name": "default_cluster", | ||
"Unquoted": false, | ||
"NamePos": 57, | ||
"NameEnd": 72 | ||
} | ||
}, | ||
"AlterExprs": [ | ||
{ | ||
"RemovePos": 73, | ||
"StatementEnd": 83 | ||
} | ||
] | ||
} | ||
] |
64 changes: 64 additions & 0 deletions
64
parser/testdata/dml/output/alter_table_with_modify_ttl.sql.golden.json
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,64 @@ | ||
[ | ||
{ | ||
"AlterPos": 0, | ||
"StatementEnd": 112, | ||
"TableIdentifier": { | ||
"Database": { | ||
"Name": "infra", | ||
"Unquoted": false, | ||
"NamePos": 12, | ||
"NameEnd": 17 | ||
}, | ||
"Table": { | ||
"Name": "flow_processed_emails_local", | ||
"Unquoted": false, | ||
"NamePos": 18, | ||
"NameEnd": 45 | ||
} | ||
}, | ||
"OnCluster": { | ||
"OnPos": 46, | ||
"Expr": { | ||
"Name": "default_cluster", | ||
"Unquoted": false, | ||
"NamePos": 57, | ||
"NameEnd": 72 | ||
} | ||
}, | ||
"AlterExprs": [ | ||
{ | ||
"ModifyPos": 73, | ||
"StatementEnd": 112, | ||
"TTL": { | ||
"TTLPos": 84, | ||
"Expr": { | ||
"LeftExpr": { | ||
"Name": "created_at", | ||
"Unquoted": false, | ||
"NamePos": 84, | ||
"NameEnd": 94 | ||
}, | ||
"Operation": "+", | ||
"RightExpr": { | ||
"IntervalPos": 97, | ||
"Expr": { | ||
"NumPos": 106, | ||
"NumEnd": 107, | ||
"Literal": "3", | ||
"Base": 10 | ||
}, | ||
"Unit": { | ||
"Name": "YEAR", | ||
"Unquoted": false, | ||
"NamePos": 108, | ||
"NameEnd": 112 | ||
} | ||
}, | ||
"HasGlobal": false, | ||
"HasNot": false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] |