We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[DuckDB] Parsing DuckDB SQL will convert into illegal usage of CURRENT_TIMESTAMP, CURRENT_DATE
It appears that CURRENT_TIMESTAMP/CURRENT_DATE will be transformed into CURRENT_TIMESTAMP()/CURRENT_DATE() which is illegal in DuckDB.

**Fully reproducible code snippet**

```python
import sqlglot
import duckdb 

ts_sql = "SELECT CURRENT_TIMESTAMP"
date_sql = "SELECT CURRENT_DATE"

ts_res = sqlglot.parse_one(ts_sql, read="duckdb").sql()
date_res = sqlglot.parse_one(date_sql, read="duckdb").sql()

print(ts_res)
print(date_res)

duckdb.execute(ts_sql).fetchall() # Works
duckdb.execute(date_sql).fetchall() # Works
duckdb.execute(ts_res).fetchall() # Doesn't work `Parser Error: syntax error at or near ")"`
duckdb.execute(date_res).fetchall() # Doesn't work `Parser Error: syntax error at or near ")"`
```

**Official Documentation**
[DuckDB current_date](https://duckdb.org/docs/sql/functions/date)
current_timestamp appears to be missing a docs page.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sqlglot/dialects/duckdb.py`
Content:
```
1 from __future__ import annotations
2 
3 import typing as t
4 
5 from sqlglot import exp, generator, parser, tokens
6 from sqlglot.dialects.dialect import (
7     Dialect,
8     approx_count_distinct_sql,
9     arrow_json_extract_scalar_sql,
10     arrow_json_extract_sql,
11     datestrtodate_sql,
12     format_time_lambda,
13     no_comment_column_constraint_sql,
14     no_pivot_sql,
15     no_properties_sql,
16     no_safe_divide_sql,
17     rename_func,
18     str_position_sql,
19     str_to_time_sql,
20     timestamptrunc_sql,
21     timestrtotime_sql,
22     ts_or_ds_to_date_sql,
23 )
24 from sqlglot.helper import seq_get
25 from sqlglot.tokens import TokenType
26 
27 
28 def _ts_or_ds_add_sql(self: generator.Generator, expression: exp.TsOrDsAdd) -> str:
29     this = self.sql(expression, "this")
30     unit = self.sql(expression, "unit").strip("'") or "DAY"
31     return f"CAST({this} AS DATE) + {self.sql(exp.Interval(this=expression.expression, unit=unit))}"
32 
33 
34 def _date_add_sql(self: generator.Generator, expression: exp.DateAdd) -> str:
35     this = self.sql(expression, "this")
36     unit = self.sql(expression, "unit").strip("'") or "DAY"
37     return f"{this} + {self.sql(exp.Interval(this=expression.expression, unit=unit))}"
38 
39 
40 def _array_sort_sql(self: generator.Generator, expression: exp.ArraySort) -> str:
41     if expression.expression:
42         self.unsupported("DUCKDB ARRAY_SORT does not support a comparator")
43     return f"ARRAY_SORT({self.sql(expression, 'this')})"
44 
45 
46 def _sort_array_sql(self: generator.Generator, expression: exp.SortArray) -> str:
47     this = self.sql(expression, "this")
48     if expression.args.get("asc") == exp.false():
49         return f"ARRAY_REVERSE_SORT({this})"
50     return f"ARRAY_SORT({this})"
51 
52 
53 def _sort_array_reverse(args: t.Sequence) -> exp.Expression:
54     return exp.SortArray(this=seq_get(args, 0), asc=exp.false())
55 
56 
57 def _parse_date_diff(args: t.Sequence) -> exp.Expression:
58     return exp.DateDiff(
59         this=seq_get(args, 2),
60         expression=seq_get(args, 1),
61         unit=seq_get(args, 0),
62     )
63 
64 
65 def _struct_sql(self: generator.Generator, expression: exp.Struct) -> str:
66     args = [
67         f"'{e.name or e.this.name}': {self.sql(e, 'expression')}" for e in expression.expressions
68     ]
69     return f"{{{', '.join(args)}}}"
70 
71 
72 def _datatype_sql(self: generator.Generator, expression: exp.DataType) -> str:
73     if expression.this == exp.DataType.Type.ARRAY:
74         return f"{self.expressions(expression, flat=True)}[]"
75     return self.datatype_sql(expression)
76 
77 
78 def _regexp_extract_sql(self: generator.Generator, expression: exp.RegexpExtract) -> str:
79     bad_args = list(filter(expression.args.get, ("position", "occurrence")))
80     if bad_args:
81         self.unsupported(f"REGEXP_EXTRACT does not support arg(s) {bad_args}")
82 
83     return self.func(
84         "REGEXP_EXTRACT",
85         expression.args.get("this"),
86         expression.args.get("expression"),
87         expression.args.get("group"),
88     )
89 
90 
91 class DuckDB(Dialect):
92     class Tokenizer(tokens.Tokenizer):
93         KEYWORDS = {
94             **tokens.Tokenizer.KEYWORDS,
95             "~": TokenType.RLIKE,
96             ":=": TokenType.EQ,
97             "ATTACH": TokenType.COMMAND,
98             "BINARY": TokenType.VARBINARY,
99             "BPCHAR": TokenType.TEXT,
100             "BITSTRING": TokenType.BIT,
101             "CHAR": TokenType.TEXT,
102             "CHARACTER VARYING": TokenType.TEXT,
103             "EXCLUDE": TokenType.EXCEPT,
104             "INT1": TokenType.TINYINT,
105             "LOGICAL": TokenType.BOOLEAN,
106             "NUMERIC": TokenType.DOUBLE,
107             "SIGNED": TokenType.INT,
108             "STRING": TokenType.VARCHAR,
109             "UBIGINT": TokenType.UBIGINT,
110             "UINTEGER": TokenType.UINT,
111             "USMALLINT": TokenType.USMALLINT,
112             "UTINYINT": TokenType.UTINYINT,
113         }
114 
115     class Parser(parser.Parser):
116         FUNCTIONS = {
117             **parser.Parser.FUNCTIONS,  # type: ignore
118             "APPROX_COUNT_DISTINCT": exp.ApproxDistinct.from_arg_list,
119             "ARRAY_LENGTH": exp.ArraySize.from_arg_list,
120             "ARRAY_SORT": exp.SortArray.from_arg_list,
121             "ARRAY_REVERSE_SORT": _sort_array_reverse,
122             "DATEDIFF": _parse_date_diff,
123             "DATE_DIFF": _parse_date_diff,
124             "EPOCH": exp.TimeToUnix.from_arg_list,
125             "EPOCH_MS": lambda args: exp.UnixToTime(
126                 this=exp.Div(
127                     this=seq_get(args, 0),
128                     expression=exp.Literal.number(1000),
129                 )
130             ),
131             "LIST_REVERSE_SORT": _sort_array_reverse,
132             "LIST_SORT": exp.SortArray.from_arg_list,
133             "LIST_VALUE": exp.Array.from_arg_list,
134             "REGEXP_MATCHES": exp.RegexpLike.from_arg_list,
135             "STRFTIME": format_time_lambda(exp.TimeToStr, "duckdb"),
136             "STRING_SPLIT": exp.Split.from_arg_list,
137             "STRING_SPLIT_REGEX": exp.RegexpSplit.from_arg_list,
138             "STRING_TO_ARRAY": exp.Split.from_arg_list,
139             "STRPTIME": format_time_lambda(exp.StrToTime, "duckdb"),
140             "STRUCT_PACK": exp.Struct.from_arg_list,
141             "STR_SPLIT": exp.Split.from_arg_list,
142             "STR_SPLIT_REGEX": exp.RegexpSplit.from_arg_list,
143             "TO_TIMESTAMP": exp.UnixToTime.from_arg_list,
144             "UNNEST": exp.Explode.from_arg_list,
145         }
146 
147         TYPE_TOKENS = {
148             *parser.Parser.TYPE_TOKENS,
149             TokenType.UBIGINT,
150             TokenType.UINT,
151             TokenType.USMALLINT,
152             TokenType.UTINYINT,
153         }
154 
155     class Generator(generator.Generator):
156         JOIN_HINTS = False
157         TABLE_HINTS = False
158         LIMIT_FETCH = "LIMIT"
159         STRUCT_DELIMITER = ("(", ")")
160 
161         TRANSFORMS = {
162             **generator.Generator.TRANSFORMS,
163             exp.ApproxDistinct: approx_count_distinct_sql,
164             exp.Array: lambda self, e: self.func("ARRAY", e.expressions[0])
165             if isinstance(seq_get(e.expressions, 0), exp.Select)
166             else rename_func("LIST_VALUE")(self, e),
167             exp.ArraySize: rename_func("ARRAY_LENGTH"),
168             exp.ArraySort: _array_sort_sql,
169             exp.ArraySum: rename_func("LIST_SUM"),
170             exp.CommentColumnConstraint: no_comment_column_constraint_sql,
171             exp.DayOfMonth: rename_func("DAYOFMONTH"),
172             exp.DayOfWeek: rename_func("DAYOFWEEK"),
173             exp.DayOfYear: rename_func("DAYOFYEAR"),
174             exp.DataType: _datatype_sql,
175             exp.DateAdd: _date_add_sql,
176             exp.DateDiff: lambda self, e: self.func(
177                 "DATE_DIFF", f"'{e.args.get('unit', 'day')}'", e.expression, e.this
178             ),
179             exp.DateStrToDate: datestrtodate_sql,
180             exp.DateToDi: lambda self, e: f"CAST(STRFTIME({self.sql(e, 'this')}, {DuckDB.dateint_format}) AS INT)",
181             exp.DiToDate: lambda self, e: f"CAST(STRPTIME(CAST({self.sql(e, 'this')} AS TEXT), {DuckDB.dateint_format}) AS DATE)",
182             exp.Explode: rename_func("UNNEST"),
183             exp.JSONExtract: arrow_json_extract_sql,
184             exp.JSONExtractScalar: arrow_json_extract_scalar_sql,
185             exp.JSONBExtract: arrow_json_extract_sql,
186             exp.JSONBExtractScalar: arrow_json_extract_scalar_sql,
187             exp.LogicalOr: rename_func("BOOL_OR"),
188             exp.LogicalAnd: rename_func("BOOL_AND"),
189             exp.Pivot: no_pivot_sql,
190             exp.Properties: no_properties_sql,
191             exp.RegexpExtract: _regexp_extract_sql,
192             exp.RegexpLike: rename_func("REGEXP_MATCHES"),
193             exp.RegexpSplit: rename_func("STR_SPLIT_REGEX"),
194             exp.SafeDivide: no_safe_divide_sql,
195             exp.Split: rename_func("STR_SPLIT"),
196             exp.SortArray: _sort_array_sql,
197             exp.StrPosition: str_position_sql,
198             exp.StrToDate: lambda self, e: f"CAST({str_to_time_sql(self, e)} AS DATE)",
199             exp.StrToTime: str_to_time_sql,
200             exp.StrToUnix: lambda self, e: f"EPOCH(STRPTIME({self.sql(e, 'this')}, {self.format_time(e)}))",
201             exp.Struct: _struct_sql,
202             exp.TimestampTrunc: timestamptrunc_sql,
203             exp.TimeStrToDate: lambda self, e: f"CAST({self.sql(e, 'this')} AS DATE)",
204             exp.TimeStrToTime: timestrtotime_sql,
205             exp.TimeStrToUnix: lambda self, e: f"EPOCH(CAST({self.sql(e, 'this')} AS TIMESTAMP))",
206             exp.TimeToStr: lambda self, e: f"STRFTIME({self.sql(e, 'this')}, {self.format_time(e)})",
207             exp.TimeToUnix: rename_func("EPOCH"),
208             exp.TsOrDiToDi: lambda self, e: f"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS TEXT), '-', ''), 1, 8) AS INT)",
209             exp.TsOrDsAdd: _ts_or_ds_add_sql,
210             exp.TsOrDsToDate: ts_or_ds_to_date_sql("duckdb"),
211             exp.UnixToStr: lambda self, e: f"STRFTIME(TO_TIMESTAMP({self.sql(e, 'this')}), {self.format_time(e)})",
212             exp.UnixToTime: rename_func("TO_TIMESTAMP"),
213             exp.UnixToTimeStr: lambda self, e: f"CAST(TO_TIMESTAMP({self.sql(e, 'this')}) AS TEXT)",
214             exp.WeekOfYear: rename_func("WEEKOFYEAR"),
215         }
216 
217         TYPE_MAPPING = {
218             **generator.Generator.TYPE_MAPPING,
219             exp.DataType.Type.BINARY: "BLOB",
220             exp.DataType.Type.CHAR: "TEXT",
221             exp.DataType.Type.FLOAT: "REAL",
222             exp.DataType.Type.NCHAR: "TEXT",
223             exp.DataType.Type.NVARCHAR: "TEXT",
224             exp.DataType.Type.UINT: "UINTEGER",
225             exp.DataType.Type.VARBINARY: "BLOB",
226             exp.DataType.Type.VARCHAR: "TEXT",
227         }
228 
229         STAR_MAPPING = {**generator.Generator.STAR_MAPPING, "except": "EXCLUDE"}
230 
231         PROPERTIES_LOCATION = {
232             **generator.Generator.PROPERTIES_LOCATION,  # type: ignore
233             exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
234         }
235 
236         def tablesample_sql(
237             self, expression: exp.TableSample, seed_prefix: str = "SEED", sep=" AS "
238         ) -> str:
239             return super().tablesample_sql(expression, seed_prefix="REPEATABLE", sep=sep)
240
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sqlglot/dialects/duckdb.py b/sqlglot/dialects/duckdb.py
--- a/sqlglot/dialects/duckdb.py
+++ b/sqlglot/dialects/duckdb.py
@@ -168,6 +168,9 @@
             exp.ArraySort: _array_sort_sql,
             exp.ArraySum: rename_func("LIST_SUM"),
             exp.CommentColumnConstraint: no_comment_column_constraint_sql,
+            exp.CurrentDate: lambda self, e: "CURRENT_DATE",
+            exp.CurrentTime: lambda self, e: "CURRENT_TIME",
+            exp.CurrentTimestamp: lambda self, e: "CURRENT_TIMESTAMP",
             exp.DayOfMonth: rename_func("DAYOFMONTH"),
             exp.DayOfWeek: rename_func("DAYOFWEEK"),
             exp.DayOfYear: rename_func("DAYOFYEAR"),

{"golden_diff": "diff --git a/sqlglot/dialects/duckdb.py b/sqlglot/dialects/duckdb.py\n--- a/sqlglot/dialects/duckdb.py\n+++ b/sqlglot/dialects/duckdb.py\n@@ -168,6 +168,9 @@\n             exp.ArraySort: _array_sort_sql,\n             exp.ArraySum: rename_func(\"LIST_SUM\"),\n             exp.CommentColumnConstraint: no_comment_column_constraint_sql,\n+            exp.CurrentDate: lambda self, e: \"CURRENT_DATE\",\n+            exp.CurrentTime: lambda self, e: \"CURRENT_TIME\",\n+            exp.CurrentTimestamp: lambda self, e: \"CURRENT_TIMESTAMP\",\n             exp.DayOfMonth: rename_func(\"DAYOFMONTH\"),\n             exp.DayOfWeek: rename_func(\"DAYOFWEEK\"),\n             exp.DayOfYear: rename_func(\"DAYOFYEAR\"),\n", "issue": "[DuckDB] Parsing DuckDB SQL will convert into illegal usage of CURRENT_TIMESTAMP, CURRENT_DATE\nIt appears that CURRENT_TIMESTAMP/CURRENT_DATE will be transformed into CURRENT_TIMESTAMP()/CURRENT_DATE() which is illegal in DuckDB.\r\n\r\n**Fully reproducible code snippet**\r\n\r\n```python\r\nimport sqlglot\r\nimport duckdb \r\n\r\nts_sql = \"SELECT CURRENT_TIMESTAMP\"\r\ndate_sql = \"SELECT CURRENT_DATE\"\r\n\r\nts_res = sqlglot.parse_one(ts_sql, read=\"duckdb\").sql()\r\ndate_res = sqlglot.parse_one(date_sql, read=\"duckdb\").sql()\r\n\r\nprint(ts_res)\r\nprint(date_res)\r\n\r\nduckdb.execute(ts_sql).fetchall() # Works\r\nduckdb.execute(date_sql).fetchall() # Works\r\nduckdb.execute(ts_res).fetchall() # Doesn't work `Parser Error: syntax error at or near \")\"`\r\nduckdb.execute(date_res).fetchall() # Doesn't work `Parser Error: syntax error at or near \")\"`\r\n```\r\n\r\n**Official Documentation**\r\n[DuckDB current_date](https://duckdb.org/docs/sql/functions/date)\r\ncurrent_timestamp appears to be missing a docs page.\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nimport typing as t\n\nfrom sqlglot import exp, generator, parser, tokens\nfrom sqlglot.dialects.dialect import (\n    Dialect,\n    approx_count_distinct_sql,\n    arrow_json_extract_scalar_sql,\n    arrow_json_extract_sql,\n    datestrtodate_sql,\n    format_time_lambda,\n    no_comment_column_constraint_sql,\n    no_pivot_sql,\n    no_properties_sql,\n    no_safe_divide_sql,\n    rename_func,\n    str_position_sql,\n    str_to_time_sql,\n    timestamptrunc_sql,\n    timestrtotime_sql,\n    ts_or_ds_to_date_sql,\n)\nfrom sqlglot.helper import seq_get\nfrom sqlglot.tokens import TokenType\n\n\ndef _ts_or_ds_add_sql(self: generator.Generator, expression: exp.TsOrDsAdd) -> str:\n    this = self.sql(expression, \"this\")\n    unit = self.sql(expression, \"unit\").strip(\"'\") or \"DAY\"\n    return f\"CAST({this} AS DATE) + {self.sql(exp.Interval(this=expression.expression, unit=unit))}\"\n\n\ndef _date_add_sql(self: generator.Generator, expression: exp.DateAdd) -> str:\n    this = self.sql(expression, \"this\")\n    unit = self.sql(expression, \"unit\").strip(\"'\") or \"DAY\"\n    return f\"{this} + {self.sql(exp.Interval(this=expression.expression, unit=unit))}\"\n\n\ndef _array_sort_sql(self: generator.Generator, expression: exp.ArraySort) -> str:\n    if expression.expression:\n        self.unsupported(\"DUCKDB ARRAY_SORT does not support a comparator\")\n    return f\"ARRAY_SORT({self.sql(expression, 'this')})\"\n\n\ndef _sort_array_sql(self: generator.Generator, expression: exp.SortArray) -> str:\n    this = self.sql(expression, \"this\")\n    if expression.args.get(\"asc\") == exp.false():\n        return f\"ARRAY_REVERSE_SORT({this})\"\n    return f\"ARRAY_SORT({this})\"\n\n\ndef _sort_array_reverse(args: t.Sequence) -> exp.Expression:\n    return exp.SortArray(this=seq_get(args, 0), asc=exp.false())\n\n\ndef _parse_date_diff(args: t.Sequence) -> exp.Expression:\n    return exp.DateDiff(\n        this=seq_get(args, 2),\n        expression=seq_get(args, 1),\n        unit=seq_get(args, 0),\n    )\n\n\ndef _struct_sql(self: generator.Generator, expression: exp.Struct) -> str:\n    args = [\n        f\"'{e.name or e.this.name}': {self.sql(e, 'expression')}\" for e in expression.expressions\n    ]\n    return f\"{{{', '.join(args)}}}\"\n\n\ndef _datatype_sql(self: generator.Generator, expression: exp.DataType) -> str:\n    if expression.this == exp.DataType.Type.ARRAY:\n        return f\"{self.expressions(expression, flat=True)}[]\"\n    return self.datatype_sql(expression)\n\n\ndef _regexp_extract_sql(self: generator.Generator, expression: exp.RegexpExtract) -> str:\n    bad_args = list(filter(expression.args.get, (\"position\", \"occurrence\")))\n    if bad_args:\n        self.unsupported(f\"REGEXP_EXTRACT does not support arg(s) {bad_args}\")\n\n    return self.func(\n        \"REGEXP_EXTRACT\",\n        expression.args.get(\"this\"),\n        expression.args.get(\"expression\"),\n        expression.args.get(\"group\"),\n    )\n\n\nclass DuckDB(Dialect):\n    class Tokenizer(tokens.Tokenizer):\n        KEYWORDS = {\n            **tokens.Tokenizer.KEYWORDS,\n            \"~\": TokenType.RLIKE,\n            \":=\": TokenType.EQ,\n            \"ATTACH\": TokenType.COMMAND,\n            \"BINARY\": TokenType.VARBINARY,\n            \"BPCHAR\": TokenType.TEXT,\n            \"BITSTRING\": TokenType.BIT,\n            \"CHAR\": TokenType.TEXT,\n            \"CHARACTER VARYING\": TokenType.TEXT,\n            \"EXCLUDE\": TokenType.EXCEPT,\n            \"INT1\": TokenType.TINYINT,\n            \"LOGICAL\": TokenType.BOOLEAN,\n            \"NUMERIC\": TokenType.DOUBLE,\n            \"SIGNED\": TokenType.INT,\n            \"STRING\": TokenType.VARCHAR,\n            \"UBIGINT\": TokenType.UBIGINT,\n            \"UINTEGER\": TokenType.UINT,\n            \"USMALLINT\": TokenType.USMALLINT,\n            \"UTINYINT\": TokenType.UTINYINT,\n        }\n\n    class Parser(parser.Parser):\n        FUNCTIONS = {\n            **parser.Parser.FUNCTIONS,  # type: ignore\n            \"APPROX_COUNT_DISTINCT\": exp.ApproxDistinct.from_arg_list,\n            \"ARRAY_LENGTH\": exp.ArraySize.from_arg_list,\n            \"ARRAY_SORT\": exp.SortArray.from_arg_list,\n            \"ARRAY_REVERSE_SORT\": _sort_array_reverse,\n            \"DATEDIFF\": _parse_date_diff,\n            \"DATE_DIFF\": _parse_date_diff,\n            \"EPOCH\": exp.TimeToUnix.from_arg_list,\n            \"EPOCH_MS\": lambda args: exp.UnixToTime(\n                this=exp.Div(\n                    this=seq_get(args, 0),\n                    expression=exp.Literal.number(1000),\n                )\n            ),\n            \"LIST_REVERSE_SORT\": _sort_array_reverse,\n            \"LIST_SORT\": exp.SortArray.from_arg_list,\n            \"LIST_VALUE\": exp.Array.from_arg_list,\n            \"REGEXP_MATCHES\": exp.RegexpLike.from_arg_list,\n            \"STRFTIME\": format_time_lambda(exp.TimeToStr, \"duckdb\"),\n            \"STRING_SPLIT\": exp.Split.from_arg_list,\n            \"STRING_SPLIT_REGEX\": exp.RegexpSplit.from_arg_list,\n            \"STRING_TO_ARRAY\": exp.Split.from_arg_list,\n            \"STRPTIME\": format_time_lambda(exp.StrToTime, \"duckdb\"),\n            \"STRUCT_PACK\": exp.Struct.from_arg_list,\n            \"STR_SPLIT\": exp.Split.from_arg_list,\n            \"STR_SPLIT_REGEX\": exp.RegexpSplit.from_arg_list,\n            \"TO_TIMESTAMP\": exp.UnixToTime.from_arg_list,\n            \"UNNEST\": exp.Explode.from_arg_list,\n        }\n\n        TYPE_TOKENS = {\n            *parser.Parser.TYPE_TOKENS,\n            TokenType.UBIGINT,\n            TokenType.UINT,\n            TokenType.USMALLINT,\n            TokenType.UTINYINT,\n        }\n\n    class Generator(generator.Generator):\n        JOIN_HINTS = False\n        TABLE_HINTS = False\n        LIMIT_FETCH = \"LIMIT\"\n        STRUCT_DELIMITER = (\"(\", \")\")\n\n        TRANSFORMS = {\n            **generator.Generator.TRANSFORMS,\n            exp.ApproxDistinct: approx_count_distinct_sql,\n            exp.Array: lambda self, e: self.func(\"ARRAY\", e.expressions[0])\n            if isinstance(seq_get(e.expressions, 0), exp.Select)\n            else rename_func(\"LIST_VALUE\")(self, e),\n            exp.ArraySize: rename_func(\"ARRAY_LENGTH\"),\n            exp.ArraySort: _array_sort_sql,\n            exp.ArraySum: rename_func(\"LIST_SUM\"),\n            exp.CommentColumnConstraint: no_comment_column_constraint_sql,\n            exp.DayOfMonth: rename_func(\"DAYOFMONTH\"),\n            exp.DayOfWeek: rename_func(\"DAYOFWEEK\"),\n            exp.DayOfYear: rename_func(\"DAYOFYEAR\"),\n            exp.DataType: _datatype_sql,\n            exp.DateAdd: _date_add_sql,\n            exp.DateDiff: lambda self, e: self.func(\n                \"DATE_DIFF\", f\"'{e.args.get('unit', 'day')}'\", e.expression, e.this\n            ),\n            exp.DateStrToDate: datestrtodate_sql,\n            exp.DateToDi: lambda self, e: f\"CAST(STRFTIME({self.sql(e, 'this')}, {DuckDB.dateint_format}) AS INT)\",\n            exp.DiToDate: lambda self, e: f\"CAST(STRPTIME(CAST({self.sql(e, 'this')} AS TEXT), {DuckDB.dateint_format}) AS DATE)\",\n            exp.Explode: rename_func(\"UNNEST\"),\n            exp.JSONExtract: arrow_json_extract_sql,\n            exp.JSONExtractScalar: arrow_json_extract_scalar_sql,\n            exp.JSONBExtract: arrow_json_extract_sql,\n            exp.JSONBExtractScalar: arrow_json_extract_scalar_sql,\n            exp.LogicalOr: rename_func(\"BOOL_OR\"),\n            exp.LogicalAnd: rename_func(\"BOOL_AND\"),\n            exp.Pivot: no_pivot_sql,\n            exp.Properties: no_properties_sql,\n            exp.RegexpExtract: _regexp_extract_sql,\n            exp.RegexpLike: rename_func(\"REGEXP_MATCHES\"),\n            exp.RegexpSplit: rename_func(\"STR_SPLIT_REGEX\"),\n            exp.SafeDivide: no_safe_divide_sql,\n            exp.Split: rename_func(\"STR_SPLIT\"),\n            exp.SortArray: _sort_array_sql,\n            exp.StrPosition: str_position_sql,\n            exp.StrToDate: lambda self, e: f\"CAST({str_to_time_sql(self, e)} AS DATE)\",\n            exp.StrToTime: str_to_time_sql,\n            exp.StrToUnix: lambda self, e: f\"EPOCH(STRPTIME({self.sql(e, 'this')}, {self.format_time(e)}))\",\n            exp.Struct: _struct_sql,\n            exp.TimestampTrunc: timestamptrunc_sql,\n            exp.TimeStrToDate: lambda self, e: f\"CAST({self.sql(e, 'this')} AS DATE)\",\n            exp.TimeStrToTime: timestrtotime_sql,\n            exp.TimeStrToUnix: lambda self, e: f\"EPOCH(CAST({self.sql(e, 'this')} AS TIMESTAMP))\",\n            exp.TimeToStr: lambda self, e: f\"STRFTIME({self.sql(e, 'this')}, {self.format_time(e)})\",\n            exp.TimeToUnix: rename_func(\"EPOCH\"),\n            exp.TsOrDiToDi: lambda self, e: f\"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS TEXT), '-', ''), 1, 8) AS INT)\",\n            exp.TsOrDsAdd: _ts_or_ds_add_sql,\n            exp.TsOrDsToDate: ts_or_ds_to_date_sql(\"duckdb\"),\n            exp.UnixToStr: lambda self, e: f\"STRFTIME(TO_TIMESTAMP({self.sql(e, 'this')}), {self.format_time(e)})\",\n            exp.UnixToTime: rename_func(\"TO_TIMESTAMP\"),\n            exp.UnixToTimeStr: lambda self, e: f\"CAST(TO_TIMESTAMP({self.sql(e, 'this')}) AS TEXT)\",\n            exp.WeekOfYear: rename_func(\"WEEKOFYEAR\"),\n        }\n\n        TYPE_MAPPING = {\n            **generator.Generator.TYPE_MAPPING,\n            exp.DataType.Type.BINARY: \"BLOB\",\n            exp.DataType.Type.CHAR: \"TEXT\",\n            exp.DataType.Type.FLOAT: \"REAL\",\n            exp.DataType.Type.NCHAR: \"TEXT\",\n            exp.DataType.Type.NVARCHAR: \"TEXT\",\n            exp.DataType.Type.UINT: \"UINTEGER\",\n            exp.DataType.Type.VARBINARY: \"BLOB\",\n            exp.DataType.Type.VARCHAR: \"TEXT\",\n        }\n\n        STAR_MAPPING = {**generator.Generator.STAR_MAPPING, \"except\": \"EXCLUDE\"}\n\n        PROPERTIES_LOCATION = {\n            **generator.Generator.PROPERTIES_LOCATION,  # type: ignore\n            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,\n        }\n\n        def tablesample_sql(\n            self, expression: exp.TableSample, seed_prefix: str = \"SEED\", sep=\" AS \"\n        ) -> str:\n            return super().tablesample_sql(expression, seed_prefix=\"REPEATABLE\", sep=sep)\n", "path": "sqlglot/dialects/duckdb.py"}], "after_files": [{"content": "from __future__ import annotations\n\nimport typing as t\n\nfrom sqlglot import exp, generator, parser, tokens\nfrom sqlglot.dialects.dialect import (\n    Dialect,\n    approx_count_distinct_sql,\n    arrow_json_extract_scalar_sql,\n    arrow_json_extract_sql,\n    datestrtodate_sql,\n    format_time_lambda,\n    no_comment_column_constraint_sql,\n    no_pivot_sql,\n    no_properties_sql,\n    no_safe_divide_sql,\n    rename_func,\n    str_position_sql,\n    str_to_time_sql,\n    timestamptrunc_sql,\n    timestrtotime_sql,\n    ts_or_ds_to_date_sql,\n)\nfrom sqlglot.helper import seq_get\nfrom sqlglot.tokens import TokenType\n\n\ndef _ts_or_ds_add_sql(self: generator.Generator, expression: exp.TsOrDsAdd) -> str:\n    this = self.sql(expression, \"this\")\n    unit = self.sql(expression, \"unit\").strip(\"'\") or \"DAY\"\n    return f\"CAST({this} AS DATE) + {self.sql(exp.Interval(this=expression.expression, unit=unit))}\"\n\n\ndef _date_add_sql(self: generator.Generator, expression: exp.DateAdd) -> str:\n    this = self.sql(expression, \"this\")\n    unit = self.sql(expression, \"unit\").strip(\"'\") or \"DAY\"\n    return f\"{this} + {self.sql(exp.Interval(this=expression.expression, unit=unit))}\"\n\n\ndef _array_sort_sql(self: generator.Generator, expression: exp.ArraySort) -> str:\n    if expression.expression:\n        self.unsupported(\"DUCKDB ARRAY_SORT does not support a comparator\")\n    return f\"ARRAY_SORT({self.sql(expression, 'this')})\"\n\n\ndef _sort_array_sql(self: generator.Generator, expression: exp.SortArray) -> str:\n    this = self.sql(expression, \"this\")\n    if expression.args.get(\"asc\") == exp.false():\n        return f\"ARRAY_REVERSE_SORT({this})\"\n    return f\"ARRAY_SORT({this})\"\n\n\ndef _sort_array_reverse(args: t.Sequence) -> exp.Expression:\n    return exp.SortArray(this=seq_get(args, 0), asc=exp.false())\n\n\ndef _parse_date_diff(args: t.Sequence) -> exp.Expression:\n    return exp.DateDiff(\n        this=seq_get(args, 2),\n        expression=seq_get(args, 1),\n        unit=seq_get(args, 0),\n    )\n\n\ndef _struct_sql(self: generator.Generator, expression: exp.Struct) -> str:\n    args = [\n        f\"'{e.name or e.this.name}': {self.sql(e, 'expression')}\" for e in expression.expressions\n    ]\n    return f\"{{{', '.join(args)}}}\"\n\n\ndef _datatype_sql(self: generator.Generator, expression: exp.DataType) -> str:\n    if expression.this == exp.DataType.Type.ARRAY:\n        return f\"{self.expressions(expression, flat=True)}[]\"\n    return self.datatype_sql(expression)\n\n\ndef _regexp_extract_sql(self: generator.Generator, expression: exp.RegexpExtract) -> str:\n    bad_args = list(filter(expression.args.get, (\"position\", \"occurrence\")))\n    if bad_args:\n        self.unsupported(f\"REGEXP_EXTRACT does not support arg(s) {bad_args}\")\n\n    return self.func(\n        \"REGEXP_EXTRACT\",\n        expression.args.get(\"this\"),\n        expression.args.get(\"expression\"),\n        expression.args.get(\"group\"),\n    )\n\n\nclass DuckDB(Dialect):\n    class Tokenizer(tokens.Tokenizer):\n        KEYWORDS = {\n            **tokens.Tokenizer.KEYWORDS,\n            \"~\": TokenType.RLIKE,\n            \":=\": TokenType.EQ,\n            \"ATTACH\": TokenType.COMMAND,\n            \"BINARY\": TokenType.VARBINARY,\n            \"BPCHAR\": TokenType.TEXT,\n            \"BITSTRING\": TokenType.BIT,\n            \"CHAR\": TokenType.TEXT,\n            \"CHARACTER VARYING\": TokenType.TEXT,\n            \"EXCLUDE\": TokenType.EXCEPT,\n            \"INT1\": TokenType.TINYINT,\n            \"LOGICAL\": TokenType.BOOLEAN,\n            \"NUMERIC\": TokenType.DOUBLE,\n            \"SIGNED\": TokenType.INT,\n            \"STRING\": TokenType.VARCHAR,\n            \"UBIGINT\": TokenType.UBIGINT,\n            \"UINTEGER\": TokenType.UINT,\n            \"USMALLINT\": TokenType.USMALLINT,\n            \"UTINYINT\": TokenType.UTINYINT,\n        }\n\n    class Parser(parser.Parser):\n        FUNCTIONS = {\n            **parser.Parser.FUNCTIONS,  # type: ignore\n            \"APPROX_COUNT_DISTINCT\": exp.ApproxDistinct.from_arg_list,\n            \"ARRAY_LENGTH\": exp.ArraySize.from_arg_list,\n            \"ARRAY_SORT\": exp.SortArray.from_arg_list,\n            \"ARRAY_REVERSE_SORT\": _sort_array_reverse,\n            \"DATEDIFF\": _parse_date_diff,\n            \"DATE_DIFF\": _parse_date_diff,\n            \"EPOCH\": exp.TimeToUnix.from_arg_list,\n            \"EPOCH_MS\": lambda args: exp.UnixToTime(\n                this=exp.Div(\n                    this=seq_get(args, 0),\n                    expression=exp.Literal.number(1000),\n                )\n            ),\n            \"LIST_REVERSE_SORT\": _sort_array_reverse,\n            \"LIST_SORT\": exp.SortArray.from_arg_list,\n            \"LIST_VALUE\": exp.Array.from_arg_list,\n            \"REGEXP_MATCHES\": exp.RegexpLike.from_arg_list,\n            \"STRFTIME\": format_time_lambda(exp.TimeToStr, \"duckdb\"),\n            \"STRING_SPLIT\": exp.Split.from_arg_list,\n            \"STRING_SPLIT_REGEX\": exp.RegexpSplit.from_arg_list,\n            \"STRING_TO_ARRAY\": exp.Split.from_arg_list,\n            \"STRPTIME\": format_time_lambda(exp.StrToTime, \"duckdb\"),\n            \"STRUCT_PACK\": exp.Struct.from_arg_list,\n            \"STR_SPLIT\": exp.Split.from_arg_list,\n            \"STR_SPLIT_REGEX\": exp.RegexpSplit.from_arg_list,\n            \"TO_TIMESTAMP\": exp.UnixToTime.from_arg_list,\n            \"UNNEST\": exp.Explode.from_arg_list,\n        }\n\n        TYPE_TOKENS = {\n            *parser.Parser.TYPE_TOKENS,\n            TokenType.UBIGINT,\n            TokenType.UINT,\n            TokenType.USMALLINT,\n            TokenType.UTINYINT,\n        }\n\n    class Generator(generator.Generator):\n        JOIN_HINTS = False\n        TABLE_HINTS = False\n        LIMIT_FETCH = \"LIMIT\"\n        STRUCT_DELIMITER = (\"(\", \")\")\n\n        TRANSFORMS = {\n            **generator.Generator.TRANSFORMS,\n            exp.ApproxDistinct: approx_count_distinct_sql,\n            exp.Array: lambda self, e: self.func(\"ARRAY\", e.expressions[0])\n            if isinstance(seq_get(e.expressions, 0), exp.Select)\n            else rename_func(\"LIST_VALUE\")(self, e),\n            exp.ArraySize: rename_func(\"ARRAY_LENGTH\"),\n            exp.ArraySort: _array_sort_sql,\n            exp.ArraySum: rename_func(\"LIST_SUM\"),\n            exp.CommentColumnConstraint: no_comment_column_constraint_sql,\n            exp.CurrentDate: lambda self, e: \"CURRENT_DATE\",\n            exp.CurrentTime: lambda self, e: \"CURRENT_TIME\",\n            exp.CurrentTimestamp: lambda self, e: \"CURRENT_TIMESTAMP\",\n            exp.DayOfMonth: rename_func(\"DAYOFMONTH\"),\n            exp.DayOfWeek: rename_func(\"DAYOFWEEK\"),\n            exp.DayOfYear: rename_func(\"DAYOFYEAR\"),\n            exp.DataType: _datatype_sql,\n            exp.DateAdd: _date_add_sql,\n            exp.DateDiff: lambda self, e: self.func(\n                \"DATE_DIFF\", f\"'{e.args.get('unit', 'day')}'\", e.expression, e.this\n            ),\n            exp.DateStrToDate: datestrtodate_sql,\n            exp.DateToDi: lambda self, e: f\"CAST(STRFTIME({self.sql(e, 'this')}, {DuckDB.dateint_format}) AS INT)\",\n            exp.DiToDate: lambda self, e: f\"CAST(STRPTIME(CAST({self.sql(e, 'this')} AS TEXT), {DuckDB.dateint_format}) AS DATE)\",\n            exp.Explode: rename_func(\"UNNEST\"),\n            exp.JSONExtract: arrow_json_extract_sql,\n            exp.JSONExtractScalar: arrow_json_extract_scalar_sql,\n            exp.JSONBExtract: arrow_json_extract_sql,\n            exp.JSONBExtractScalar: arrow_json_extract_scalar_sql,\n            exp.LogicalOr: rename_func(\"BOOL_OR\"),\n            exp.LogicalAnd: rename_func(\"BOOL_AND\"),\n            exp.Pivot: no_pivot_sql,\n            exp.Properties: no_properties_sql,\n            exp.RegexpExtract: _regexp_extract_sql,\n            exp.RegexpLike: rename_func(\"REGEXP_MATCHES\"),\n            exp.RegexpSplit: rename_func(\"STR_SPLIT_REGEX\"),\n            exp.SafeDivide: no_safe_divide_sql,\n            exp.Split: rename_func(\"STR_SPLIT\"),\n            exp.SortArray: _sort_array_sql,\n            exp.StrPosition: str_position_sql,\n            exp.StrToDate: lambda self, e: f\"CAST({str_to_time_sql(self, e)} AS DATE)\",\n            exp.StrToTime: str_to_time_sql,\n            exp.StrToUnix: lambda self, e: f\"EPOCH(STRPTIME({self.sql(e, 'this')}, {self.format_time(e)}))\",\n            exp.Struct: _struct_sql,\n            exp.TimestampTrunc: timestamptrunc_sql,\n            exp.TimeStrToDate: lambda self, e: f\"CAST({self.sql(e, 'this')} AS DATE)\",\n            exp.TimeStrToTime: timestrtotime_sql,\n            exp.TimeStrToUnix: lambda self, e: f\"EPOCH(CAST({self.sql(e, 'this')} AS TIMESTAMP))\",\n            exp.TimeToStr: lambda self, e: f\"STRFTIME({self.sql(e, 'this')}, {self.format_time(e)})\",\n            exp.TimeToUnix: rename_func(\"EPOCH\"),\n            exp.TsOrDiToDi: lambda self, e: f\"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS TEXT), '-', ''), 1, 8) AS INT)\",\n            exp.TsOrDsAdd: _ts_or_ds_add_sql,\n            exp.TsOrDsToDate: ts_or_ds_to_date_sql(\"duckdb\"),\n            exp.UnixToStr: lambda self, e: f\"STRFTIME(TO_TIMESTAMP({self.sql(e, 'this')}), {self.format_time(e)})\",\n            exp.UnixToTime: rename_func(\"TO_TIMESTAMP\"),\n            exp.UnixToTimeStr: lambda self, e: f\"CAST(TO_TIMESTAMP({self.sql(e, 'this')}) AS TEXT)\",\n            exp.WeekOfYear: rename_func(\"WEEKOFYEAR\"),\n        }\n\n        TYPE_MAPPING = {\n            **generator.Generator.TYPE_MAPPING,\n            exp.DataType.Type.BINARY: \"BLOB\",\n            exp.DataType.Type.CHAR: \"TEXT\",\n            exp.DataType.Type.FLOAT: \"REAL\",\n            exp.DataType.Type.NCHAR: \"TEXT\",\n            exp.DataType.Type.NVARCHAR: \"TEXT\",\n            exp.DataType.Type.UINT: \"UINTEGER\",\n            exp.DataType.Type.VARBINARY: \"BLOB\",\n            exp.DataType.Type.VARCHAR: \"TEXT\",\n        }\n\n        STAR_MAPPING = {**generator.Generator.STAR_MAPPING, \"except\": \"EXCLUDE\"}\n\n        PROPERTIES_LOCATION = {\n            **generator.Generator.PROPERTIES_LOCATION,  # type: ignore\n            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,\n        }\n\n        def tablesample_sql(\n            self, expression: exp.TableSample, seed_prefix: str = \"SEED\", sep=\" AS \"\n        ) -> str:\n            return super().tablesample_sql(expression, seed_prefix=\"REPEATABLE\", sep=sep)\n", "path": "sqlglot/dialects/duckdb.py"}]}