Repository: tobymao/sqlglot

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.



Discussion:

Resolving patch:
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 @@ class Generator(generator.Generator):
             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"),


Test patch:
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py
--- a/tests/dialects/test_bigquery.py
+++ b/tests/dialects/test_bigquery.py
@@ -187,7 +187,6 @@ def test_bigquery(self):
             "current_datetime",
             write={
                 "bigquery": "CURRENT_DATETIME()",
-                "duckdb": "CURRENT_DATETIME()",
                 "presto": "CURRENT_DATETIME()",
                 "hive": "CURRENT_DATETIME()",
                 "spark": "CURRENT_DATETIME()",
@@ -197,7 +196,7 @@ def test_bigquery(self):
             "current_time",
             write={
                 "bigquery": "CURRENT_TIME()",
-                "duckdb": "CURRENT_TIME()",
+                "duckdb": "CURRENT_TIME",
                 "presto": "CURRENT_TIME()",
                 "hive": "CURRENT_TIME()",
                 "spark": "CURRENT_TIME()",
@@ -207,7 +206,7 @@ def test_bigquery(self):
             "current_timestamp",
             write={
                 "bigquery": "CURRENT_TIMESTAMP()",
-                "duckdb": "CURRENT_TIMESTAMP()",
+                "duckdb": "CURRENT_TIMESTAMP",
                 "postgres": "CURRENT_TIMESTAMP",
                 "presto": "CURRENT_TIMESTAMP",
                 "hive": "CURRENT_TIMESTAMP()",
@@ -218,7 +217,7 @@ def test_bigquery(self):
             "current_timestamp()",
             write={
                 "bigquery": "CURRENT_TIMESTAMP()",
-                "duckdb": "CURRENT_TIMESTAMP()",
+                "duckdb": "CURRENT_TIMESTAMP",
                 "postgres": "CURRENT_TIMESTAMP",
                 "presto": "CURRENT_TIMESTAMP",
                 "hive": "CURRENT_TIMESTAMP()",
diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py
--- a/tests/dialects/test_duckdb.py
+++ b/tests/dialects/test_duckdb.py
@@ -6,6 +6,9 @@ class TestDuckDB(Validator):
     dialect = "duckdb"
 
     def test_time(self):
+        self.validate_identity("SELECT CURRENT_DATE")
+        self.validate_identity("SELECT CURRENT_TIMESTAMP")
+
         self.validate_all(
             "EPOCH(x)",
             read={