Skip to content

Commit f5f4ca1

Browse files
alpolishchukПолищук Александр
andauthored
feat(starrocks): Support parsing "NONE" as security option (#5099)
* Support security option parsing for StarRocks * added test case --------- Co-authored-by: Полищук Александр <[email protected]>
1 parent 886f85b commit f5f4ca1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sqlglot/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ def _parse_fallback(self, no: bool = False) -> exp.FallbackProperty:
22412241
)
22422242

22432243
def _parse_security(self) -> t.Optional[exp.SecurityProperty]:
2244-
if self._match_texts(("DEFINER", "INVOKER")):
2244+
if self._match_texts(("NONE", "DEFINER", "INVOKER")):
22452245
security_specifier = self._prev.text.upper()
22462246
return self.expression(exp.SecurityProperty, this=security_specifier)
22472247
return None

tests/dialects/test_starrocks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def test_ddl(self):
3838
self.validate_identity(
3939
"CREATE TABLE foo (col1 LARGEINT) DISTRIBUTED BY HASH (col1) BUCKETS 1"
4040
)
41+
self.validate_identity(
42+
"CREATE VIEW foo (foo_col1) SECURITY NONE AS SELECT bar_col1 FROM bar"
43+
)
4144

4245
def test_identity(self):
4346
self.validate_identity("SELECT CAST(`a`.`b` AS INT) FROM foo")

0 commit comments

Comments
 (0)