You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that CURRENT_TIMESTAMP/CURRENT_DATE will be transformed into CURRENT_TIMESTAMP()/CURRENT_DATE() which is illegal in DuckDB.
Fully reproducible code snippet
importsqlglotimportduckdbts_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() # Worksduckdb.execute(date_sql).fetchall() # Worksduckdb.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
current_timestamp appears to be missing a docs page.
The text was updated successfully, but these errors were encountered:
BTheunissen
changed the title
[DuckDB] Transpile converts into illegal usage of CURRENT_TIMESTAMP, CURRENT_DATE
[DuckDB] Parsing DuckDB SQL will convert into illegal usage of CURRENT_TIMESTAMP, CURRENT_DATE
May 4, 2023
It appears that CURRENT_TIMESTAMP/CURRENT_DATE will be transformed into CURRENT_TIMESTAMP()/CURRENT_DATE() which is illegal in DuckDB.
Fully reproducible code snippet
Official Documentation
DuckDB current_date
current_timestamp appears to be missing a docs page.
The text was updated successfully, but these errors were encountered: