Skip to content

Commit

Permalink
Feat(duckdb): add support for the GLOB table function closes #3973
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Aug 26, 2024
1 parent 8aec682 commit f7e4e4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ class Parser(parser.Parser):
}

FUNCTIONS.pop("DATE_SUB")
FUNCTIONS.pop("GLOB")

FUNCTION_PARSERS = parser.Parser.FUNCTION_PARSERS.copy()
FUNCTION_PARSERS.pop("DECODE")
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def test_duckdb(self):
parse_one("a // b", read="duckdb").assert_is(exp.IntDiv).sql(dialect="duckdb"), "a // b"
)

self.validate_identity("SELECT * FROM GLOB(x)")
self.validate_identity("SELECT MAP(['key1', 'key2', 'key3'], [10, 20, 30])")
self.validate_identity("SELECT MAP {'x': 1}")
self.validate_identity("SELECT (MAP {'x': 1})['x']")
Expand Down

0 comments on commit f7e4e4a

Please sign in to comment.