diff --git a/sqlglot/dialects/trino.py b/sqlglot/dialects/trino.py index 2fa4389895..5f95ae29b8 100644 --- a/sqlglot/dialects/trino.py +++ b/sqlglot/dialects/trino.py @@ -26,6 +26,8 @@ class Parser(Presto.Parser): **dict.fromkeys( ("WITH", "WITHOUT"), ( + ("WRAPPER"), + ("ARRAY", "WRAPPER"), ("CONDITIONAL", "WRAPPER"), ("CONDITIONAL", "ARRAY", "WRAPPED"), ("UNCONDITIONAL", "WRAPPER"), diff --git a/tests/dialects/test_trino.py b/tests/dialects/test_trino.py index d597ef40ad..7d1810fe14 100644 --- a/tests/dialects/test_trino.py +++ b/tests/dialects/test_trino.py @@ -7,6 +7,8 @@ class TestTrino(Validator): def test_trino(self): self.validate_identity("JSON_EXTRACT(content, json_path)") self.validate_identity("JSON_QUERY(content, 'lax $.HY.*')") + self.validate_identity("JSON_QUERY(content, 'strict $.HY.*' WITH WRAPPER)") + self.validate_identity("JSON_QUERY(content, 'strict $.HY.*' WITH ARRAY WRAPPER)") self.validate_identity("JSON_QUERY(content, 'strict $.HY.*' WITH UNCONDITIONAL WRAPPER)") self.validate_identity("JSON_QUERY(content, 'strict $.HY.*' WITHOUT CONDITIONAL WRAPPER)") self.validate_identity("JSON_QUERY(description, 'strict $.comment' KEEP QUOTES)")